
Increase the speed of your application download by up to 3 times
This plugin provides JavaScript minification for Maven projects. It produces a minified version of your JavaScript resources which can be used to construct a minified final artefact. It is designed to be flexible in the way it operates to allow for easy minified resource re-use across your project.
Under the hood, it currently uses the YUI Compressor and Closure Compiler but has a layer of abstraction around these tools which allows for other tools to be used.
The default behaviour of the plugin is like so:
The plugin also supports more configurable behaviour; you can give it any number of JavaScript file names which are to be used as 'split points'; if a split point is reached when collating the list of resources within a HTML file then resources up to and including that point are merged into a single file, and a new merged file begins at the following resource, if it exists.
For example, if a HTML file contains the following script references:
By default, these would all be merged into a new file 1.js and your HTML script references replaced by a single one, like:
If you configured a JavaScript split point of 'c.js', the HTML file could then contain the following script references: