Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://alchim.sourceforge.net/yuicompressor-maven-plugin/">YUI compression maven plugin</a> worked for me. I will show what all I did to make it work.</p> <blockquote> <ul> <li>To concatenate all the js files I used aggregation.</li> </ul> </blockquote> <p>Details of the elements used.</p> <blockquote> <ul> <li><strong>preProcessAggregates</strong> - To process aggregation before minification.</li> <li><strong>aggregations</strong> - To aggregate the multiple resources in folder hierarchy to a single file.</li> <li><strong>aggregation</strong> - There can be multiple aggregation elements inside parent aggregations.</li> <li><strong>insertNewLine</strong> - Insert newline after each file eof, while concatenation/aggregation of files.</li> <li><strong>inputDir</strong> - Parent directory inside which files would be searched for concatenation/aggregation.</li> <li><strong>sourceDirectory</strong> - Directory under which files would be searched for minification.</li> <li><strong>outputDirectory</strong> - Directory under which minified output would be placed.</li> <li><strong>nosuffix</strong> - If set to true, then plugin will not add '-min' to the minified file.</li> </ul> </blockquote> <p>There are 2 types of <code>&lt;exclude&gt;</code> property:-</p> <blockquote> <ul> <li>First is part of aggregation, which basically excludes files from aggregation.</li> <li>Second is part of the plugin to exclude files from minification.</li> </ul> </blockquote> <p>Plugin code:-</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;net.alchim31.maven&lt;/groupId&gt; &lt;artifactId&gt;yuicompressor-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.3.2&lt;/version&gt; &lt;configuration&gt; &lt;preProcessAggregates&gt;true&lt;/preProcessAggregates&gt; &lt;aggregations&gt; &lt;aggregation&gt; &lt;insertNewLine&gt;true&lt;/insertNewLine&gt; &lt;output&gt;${basedir}/target/single.js&lt;/output&gt; &lt;inputDir&gt;${basedir}/src/main/resources/js&lt;/inputDir&gt; &lt;includes&gt; &lt;include&gt;**/*.js&lt;/include&gt; &lt;/includes&gt; &lt;excludes&gt; &lt;exclude&gt;**/*abc.js&lt;/exclude&gt; &lt;exclude&gt;**/compressed.css&lt;/exclude&gt; &lt;/excludes&gt; &lt;/aggregation&gt; &lt;/aggregations&gt; &lt;excludes&gt; &lt;exclude&gt;**/*-min.js&lt;/exclude&gt; &lt;exclude&gt;**/*.min.js&lt;/exclude&gt; &lt;exclude&gt;**/*-min.css&lt;/exclude&gt; &lt;exclude&gt;**/*.min.css&lt;/exclude&gt; &lt;/excludes&gt; &lt;jswarn&gt;false&lt;/jswarn&gt; &lt;nosuffix&gt;false&lt;/nosuffix&gt; &lt;sourceDirectory&gt;${basedir}/target&lt;/sourceDirectory&gt; &lt;outputDirectory&gt;${basedir}/target&lt;/outputDirectory&gt; &lt;/configuration&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;compress_js_css&lt;/id&gt; &lt;phase&gt;process-resources&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;compress&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload