minify-maven-plugin
minify-maven-plugin copied to clipboard
cssSourceExcludes ignored
Using version 1.7.4. We have a non-standard product structure. Our root node where the pom is, is also the root for our source code. We have a "shared" common css/ directory at the top level and then some small css files imbedded in the src code structure. We also have some 3rd party libraries we use which are copied into js/js-lib as part of the maven build. We do not want to minify anything in the js/js-lib directory.
My pom file has:
<plugin>
<groupId>com.samaxes.maven</groupId>
<artifactId>minify-maven-plugin</artifactId>
<version>1.7.4</version>
<executions>
<execution>
<id>minify</id>
<phase>process-resources</phase>
<goals>
<goal>minify</goal>
</goals>
<configuration>
<charset>utf-8</charset>
<jsEngine>CLOSURE</jsEngine>
<skipMerge>true</skipMerge>
<nosuffix>true</nosuffix>
<closureLanguage>ECMASCRIPT5</closureLanguage>
<webappSourceDir>${project.basedir}</webappSourceDir>
<webappTargetDir>${project.build.directory}</webappTargetDir>
<cssSourceDir>.</cssSourceDir>
<cssTargetDir>/optimized/css</cssTargetDir>
<cssSourceIncludes>
<cssSourceInclude>**/*.css</cssSourceInclude>
</cssSourceIncludes>
<cssSourceExcludes>
<cssSourceExclude>js/js-lib/**.css<cssSourceExclude>
</cssSourceExcludes>
<jsSourceDir>target/classes</jsSourceDir>
<jsTargetDir>/optimized/js</jsTargetDir>
<jsSourceIncludes>
<jsSourceInclude>**/*.js</jsSourceInclude>
</jsSourceIncludes>
<jsSourceExcludes>
<jsSourceExclude>js/js-lib/**.js</jsSourceExclude>
</jsSourceExcludes>
</configuration>
</execution>
</executions>
</plugin>
When I run with this pom I get 2 messages.
No valid CSS No valid Javascript
If I remove the excludes, it finds all CSS and .js files including those in the js/js-lib.
Using the options <skipMerge>true</skipMerge>
and <nosuffix>true</nosuffix>
together can be problematic, please see #50.