I just found Maven WebJars but I would like to know how to minify those files after finishing my project. I would like to use something like a maven plugin, but I haven't found anyone. It would be helpful if someone tell me one. Thanks
How to minify and process files inside webjars?
1k views Asked by Luis Vargas At
2
There are 2 answers
0
On
There is a project called Web Resource Optimizer for Java (wro4j) which supports many JS plugins (JSHint, CSSLint et al). Check this page for usage details. Google Closure compressor and YUI Compressor are supported. You can try minification using these.
There could be another way to do this: create an antrun execution on phase prepare-package that simply
<exec>
(but it better be<javaexec>
, so you can depend on it and not on the environment) your favorite minifier. That may be not the neatest way to do this, but it surely will get the thing done, and with proper generation to${project.build.outputDirectory}
(target/classes) should not interrupt normal maven workflow.