GUACAMOLE-773: Migrate to NPM for AngularJS portion of webapp build.

This commit is contained in:
Michael Jumper
2021-04-05 14:47:04 -07:00
parent 71948a54ca
commit 1ef61687d8
426 changed files with 7086 additions and 234 deletions

View File

@@ -80,9 +80,18 @@
<webResources>
<!-- Filter translation strings -->
<!-- Add frontend folder to war package ... -->
<resource>
<directory>src/main/webapp</directory>
<directory>src/main/frontend/dist</directory>
<excludes>
<exclude>translations/*.json</exclude>
<exclude>index.html</exclude>
</excludes>
</resource>
<!-- ... but filter index.html and translation strings -->
<resource>
<directory>src/main/frontend/dist</directory>
<filtering>true</filtering>
<includes>
<include>translations/*.json</include>
@@ -119,81 +128,43 @@
</executions>
</plugin>
<!-- Pre-cache Angular templates with maven-angular-plugin -->
<!-- Build AngularJS portion of application using NPM -->
<plugin>
<groupId>com.keithbranton.mojo</groupId>
<artifactId>angular-maven-plugin</artifactId>
<version>0.3.4</version>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>
<configuration>
<workingDirectory>src/main/frontend</workingDirectory>
<installDirectory>${project.build.directory}</installDirectory>
</configuration>
<executions>
<execution>
<id>install-node-and-npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v14.16.0</nodeVersion>
</configuration>
</execution>
<execution>
<id>npm-ci</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>ci</arguments>
</configuration>
</execution>
<execution>
<id>npm-build</id>
<phase>generate-resources</phase>
<goals>
<goal>html2js</goal>
<goal>npm</goal>
</goals>
</execution>
</executions>
<configuration>
<sourceDir>${basedir}/src/main/webapp/app/</sourceDir>
<include>**/*.html</include>
<target>${basedir}/src/main/webapp/generated/templates-main/templates.js</target>
<prefix>app</prefix>
</configuration>
</plugin>
<!-- JS/CSS Minification Plugin -->
<plugin>
<groupId>com.github.buckelieg</groupId>
<artifactId>minify-maven-plugin</artifactId>
<executions>
<execution>
<id>default-cli</id>
<configuration>
<charset>UTF-8</charset>
<webappSourceDir>${project.build.directory}/${project.build.finalName}</webappSourceDir>
<cssSourceDir>/</cssSourceDir>
<cssTargetDir>/</cssTargetDir>
<cssFinalFile>guacamole.css</cssFinalFile>
<cssSourceFiles>
<cssSourceFile>license.txt</cssSourceFile>
</cssSourceFiles>
<cssSourceIncludes>
<cssSourceInclude>app/**/*.css</cssSourceInclude>
</cssSourceIncludes>
<jsSourceDir>/</jsSourceDir>
<jsTargetDir>/</jsTargetDir>
<jsFinalFile>guacamole.js</jsFinalFile>
<jsSourceFiles>
<jsSourceFile>license.txt</jsSourceFile>
<jsSourceFile>guacamole-common-js/all.js</jsSourceFile>
</jsSourceFiles>
<jsSourceIncludes>
<jsSourceInclude>app/**/*.js</jsSourceInclude>
<jsSourceInclude>generated/**/*.js</jsSourceInclude>
</jsSourceIncludes>
<!-- Do not minify and include tests -->
<jsSourceExcludes>
<jsSourceExclude>**/*.test.js</jsSourceExclude>
</jsSourceExcludes>
<jsEngine>CLOSURE</jsEngine>
<!-- Disable warnings for JSDoc annotations -->
<closureWarningLevels>
<misplacedTypeAnnotation>OFF</misplacedTypeAnnotation>
<nonStandardJsDocs>OFF</nonStandardJsDocs>
</closureWarningLevels>
<arguments>run build</arguments>
</configuration>
<goals>
<goal>minify</goal>
</goals>
</execution>
</executions>
</plugin>
@@ -249,117 +220,6 @@
<scope>runtime</scope>
</dependency>
<!-- WebJars servlet (for serving org.webjars.* resources) -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-servlet-2.x</artifactId>
<version>1.5</version>
</dependency>
<!-- Polyfills for the Blob and FileSaver APIs -->
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>blob-polyfill</artifactId>
<version>1.0.20150320</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>filesaver</artifactId>
<version>1.3.3</version>
<scope>runtime</scope>
</dependency>
<!-- Lodash -->
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>lodash</artifactId>
<version>4.17.10</version>
<scope>runtime</scope>
</dependency>
<!-- jQuery -->
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>jquery</artifactId>
<version>3.3.1</version>
<scope>runtime</scope>
</dependency>
<!-- AngularJS -->
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>angular</artifactId>
<version>1.6.9</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>angular-route</artifactId>
<version>1.6.9</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>angular-touch</artifactId>
<version>1.6.9</version>
<scope>runtime</scope>
</dependency>
<!-- Shim allowing arbitrary retrieval/creation order for AngularJS modules -->
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>angular-module-shim</artifactId>
<version>0.0.4</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>org.webjars.bower</groupId>
<artifactId>angular</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Translation support for AngularJS -->
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>angular-translate</artifactId>
<version>2.16.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>angular-translate-interpolation-messageformat</artifactId>
<version>2.16.0</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>org.webjars.bower</groupId>
<artifactId>messageformat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>messageformat</artifactId>
<version>1.0.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>angular-translate-loader-static-files</artifactId>
<version>2.16.0</version>
<scope>runtime</scope>
</dependency>
<!-- Polyfill for <datalist> element support -->
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>datalist-polyfill</artifactId>
<version>1.14.0</version>
<scope>runtime</scope>
</dependency>
<!-- Jetty 8 servlet API (websocket) -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
@@ -474,20 +334,6 @@
<artifactId>guava</artifactId>
</dependency>
<!-- JSTZ for TimeZone Detection -->
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>jstz</artifactId>
<version>1.0.10</version>
</dependency>
<!-- Pickr (JavaScript color picker) -->
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>simonwep__pickr</artifactId>
<version>1.2.6</version>
</dependency>
</dependencies>
</project>