Transparent javascript and css compression with Maven3 and Yuicompressor

There are a lot of ressources on how to use YUIcompressor on a Maven project, but several examples don’t work with Maven3, or don’t allow to replace javascript and css by their compressed version transparently.

The following example will compress files transparently when packaging the webapp in a WAR file, and keep original files for development.




  • Romain Gonord

    One thing missing is fusion of all files. Following this, it only minifies files.
    I’m using this plugin to do minify and fusion :
    You can find info there :'s less handy to use as you have to tell explicitly which files you wan’t to insert, but hey, it does the trick =)

  • Nicolas Richeton


    Will try this plugin :)

    Does it have any known issue with eclipse/m2e/wtp ?

  • Suresh S Murthy

    I have been looking for this configuration for a couple of days now.. Thanks a ton for posting this one.. works like charm!