Friday, May 23, 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.

3 comments:

Anonymous said...

Your blog keeps getting better and better! Your older articles are not as good as newer ones you have a lot more creativity and originality now keep it up!

Anonymous said...

Oh yeah? This plugin does not work at all in our project...
There is the log:
[info] Size of JavaScript files after compression: 0 bytes
[info] Compression ratio: NaN%

Unknown said...

Make sure you are pointing the plugin to the right folder.