Found a solution, and I am posting here so that everyone can see. In my case, it worked:
Instead, <exclude>src/main/webapp/js-max/patterns/*</exclude>I had to use <exclude>**/patterns/*</exclude>. So, the following complete pom configuration 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>
<exclude>**/patterns/*</exclude>
</excludes>
</configuration>
</execution>
</executions>
source
share