I would like to aggregate / assemble multiple js files into one without minifying or obfuscating them using a maven plugin. I am already using a yui plugin to obfuscate some js files into one:
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>obfuscate</id>
<phase>process-resources</phase>
<goals>
<goal>compress</goal>
</goals>
<configuration>
<nosuffix>true</nosuffix>
<linebreakpos>-1</linebreakpos>
<aggregations>
<aggregation>
<removeIncluded>true</removeIncluded>
<insertNewLine>false</insertNewLine>
<output>${project.build.directory}/${project.build.finalName}/all.js</output>
<includes>
<include>**/*.js</include>
</includes>
<excludes>
<exclude>**/include/*.js</exclude>
</excludes>
</aggregation>
</aggregations>
</configuration>
</execution>
</executions>
</plugin>
Now I want the same js files aggregated without minification or obfuscation in a file allForDev.js . The goal is to have one file for development and one for production. Its going to be useful to see the whole scripts when debugging in developer tools. If I don't find a way to do this I'll be forced to place a lot of script tags to load all those scirpts (which is not the end of the world :) but I would like to do it in a cleaner way).
I can see that the assemble plugin has the following formats:
zip tar.gz tar.bz2 jar dir war and any other format that the ArchiveManager has been configured for
Is there a way I can use the assemble maven plugin to do this? As much as I looked there were a bunch of examples to create zips jars and wars, but none to match what I want to do. Or did I miss something?
Is there another plugin I could use?
As a side note, I tried using a second execution of the yui plugin to create a second js file, but I had no luck in creating 2 files. I also tried providing 2 yui plugins, with no luck again. I think that's not possible either.
Cheers,
Despot
The answer would lie in wro4j library. For a more precise setup see:
Javascript and CSS files combining in Maven build WITHOUT compression, minification etc