I want to exclude a folder containing a set of javascript files that YUI compressor would not compile and pump out errors. I am trying this with the <exclude>folder</exclude>
tag, which is not working - YUI is still trying to compress the files in the folder.
Below is my pom configuration:
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<id>compressyui</id>
<phase>process-resources</phase>
<goals>
<goal>compress</goal>
</goals>
<configuration>
<nosuffix>true</nosuffix>
<warSourceDirectory>src/main/webapp</warSourceDirectory>
<jswarn>false</jswarn>
<sourceDirectory>src/main/webapp/js-max</sourceDirectory>
<webappDirectory>src/main/webapp</webappDirectory>
<outputDirectory>src/main/webapp/js</outputDirectory>
<force>true</force>
<excludes>
<!-- yuicompressor fails to compile patterns library, hence stopping full build -->
<!-- We won't be modifying this library so will exclude it for now -->
<exclude>src/main/webapp/js-max/patterns/*</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
Any idea how to accomplish this?
Found the solution, and I'm posting here so everyone can see. For my case, the following worked:
Instead of <exclude>src/main/webapp/js-max/patterns/*</exclude>
, I had to use <exclude>**/patterns/*</exclude>
. So the following is the complete pom config that worked for me:
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<id>compressyui</id>
<phase>process-resources</phase>
<goals>
<goal>compress</goal>
</goals>
<configuration>
<nosuffix>true</nosuffix>
<warSourceDirectory>src/main/webapp</warSourceDirectory>
<jswarn>false</jswarn>
<sourceDirectory>src/main/webapp/js-max</sourceDirectory>
<webappDirectory>src/main/webapp</webappDirectory>
<outputDirectory>src/main/webapp/js</outputDirectory>
<force>true</force>
<excludes>
<!-- yuicompressor fails to compile patterns library, hence stopping full build -->
<!-- We won't be modifying this library so will exclude it for now -->
<exclude>**/patterns/*</exclude>
</excludes>
</configuration>
</execution>
</executions>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With