Thursday, May 22, 2008

maven-js-plugin

Wao,
I was blown away by the ease of use of this maven plugin.
Just add it to your pom.xml lie this:

<plugin>
<groupId>com.mobilvox.ossi.mojo</groupId>

<artifactId>maven-js-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<mergeWarFiles>true</mergeWarFiles>

<classifier>js-compressed</classifier>
</configuration>
</plugin>


And then in the maven output, during the package phase, you get to see something like this:

[info] JavaScript file compression complete.
[info] Size of JavaScript files after compression: 1612632 bytes
[info] Compression ratio: 27.103024264908303%
[info] Creating WAR: mywar.war with compressed JavaScript

So there you go, another reason to love maven.

0 comments: