edit a source file using maven at build time

Tag: maven Author: cndxhy Date: 2010-09-11

I have one freemarker template file which loads all css and js files used in web app. But these multiple http requests causing increased page load time. I have asked to use only one js file combining all js files and minimize it and similarly for css.

The problem is USER doesn't want to make changes to template file but instead asked me to make changes at runtime while building the WAR using maven.

Now is it possible to do so? Any comments from your experience.

Thanks, Hanumant.

Best Answer

There's a lot of tools for this. Take a look at YUI Compressor Maven Mojo, for instance.

comments:

Thanks for the reply. Just found this ... but forgot to update here.