I'm using Samaxes minify maven plugin to minify js and css files. The plugin works fine in creating new files with a minifies js and css, but I'd like that the minified files will have the same name of the original files (overwriting them). So I've tried to add the nosuffix true in the pom.xml, as below:
<plugin>
<groupId>com.samaxes.maven</groupId>
<artifactId>minify-maven-plugin</artifactId>
<version>1.7.2</version>
<executions>
<execution>
<id>default-minify</id>
<configuration>
<charset>UTF-8</charset>
<closureCompilationLevel>WHITESPACE_ONLY</closureCompilationLevel>
<nosuffix>true</nosuffix>
<skipMerge>true</skipMerge>
<verbose>true</verbose>
<yuiPreserveAllSemiColons>true</yuiPreserveAllSemiColons>
<webappSourceDir>${basedir}/WebContent</webappSourceDir>
<cssSourceDir>css</cssSourceDir>
<cssSourceIncludes>
<cssSourceInclude>**/*.css</cssSourceInclude>
</cssSourceIncludes>
<cssSourceExcludes>
<cssSourceExclude>**/*.min.css</cssSourceExclude>
</cssSourceExcludes>
<jsSourceDir>scripts</jsSourceDir>
<jsSourceIncludes>
<jsSourceInclude>**/*.js</jsSourceInclude>
</jsSourceIncludes>
<jsSourceExcludes>
<jsSourceExclude>**/*.min.js</jsSourceExclude>
</jsSourceExcludes>
</configuration>
<goals>
<goal>minify</goal>
</goals>
</execution>
</executions>
</plugin>
This is the plugin configuration in the pom.xml, all the options there are working fine (it identifies the sources, skips the merging, etc) but the nosuffix set to true doesn't overwrite the original files. What I don't understand is that the plugin understands perfectly the source and the destination, it even logs that it saved some space, but the output is not minified:
[INFO] Creating the minified file [/mydir/css/styles.css].
[INFO] Uncompressed size: 32490 bytes.
[INFO] Compressed size: 24188 bytes minified (5833 bytes gzipped).
What am I missing?