We use the frontend-maven-plugin to use grunt and gazebo in our builds. With the Frontend Maven plugin, I can install NPM locally, use Bower to load Java libraries, and run Grunt to optimize and obfuscate my code.
Like this with some simplification:
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>0.0.24</version>
<executions>
<execution>
<id>install node and npm</id>
<goals> <goal>install-node-and-npm</goal> </goals>
...
</execution>
<execution>
<id>npm-install</id>
<goals> <goal>npm</goal> </goals>
...
</execution>
<execution>
<id>bower-install</id>
<goals> <goal>bower</goal> </goals>
...
</execution>
<execution>
<id>grunt-build</id>
<goals> <goal>grunt</goal> </goals>
...
</execution>
</executions>
</plugin>
Note that the latest execution is grunt-build, in which JavaScript files are merged together, optimized (returns, comments, and other things removed) and obfuscation.
. , , JavaScript , . . grunt-build
.
. development
, . pom.xml
, . .
, . 50 pom.xml
.
, , - , , . . , Java, . , .
, frontend-maven-plugin
. development
. , , frontend-maven-plugin
, , frontend-maven-plugin
, grunt.
pom.xm
, Maven ?