I have src and src_backup directories that are identical except that I have created src_backup from src by renaming (cache busting purpose) all the .js and .css files in
src/main/webapp/resources directory.
I am using maven-war-plugin 2.4. I want the WAR file to include renamed files from
src_backup/main/webapp/resources
and exclude original files from
src/main/webapp/resources
I am able to include from src_backup but cannot exclude from src. What I end up getting is the WAR file containing both versions of files (original ones as well as renamed ones). I have read more than 5 different sources (such as stackoverflow) and tried more than 20 different ways to do so but it does not work.
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<warName>targetWAR</warName>
<warSourceExcludes>/${baseDir}/src/main/webapp/resources</warSourceExcludes>
<webResources>
<resource>
<directory>src_backup/main/webapp/resources</directory>
<targetPath>resources</targetPath>
</resource>
<resource>
<directory>src_backup/main/webapp/WEB-INF/views</directory>
<targetPath>WEB-INF/views</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
I have also tried to use resources tag in the build tag but did not work.
<resources>
<resource>
<directory>src/main/webapp/resources</directory>
<excludes>
<exclude>*</exclude>
</excludes>
</resource>
</resources>
I am sure I am missing something. Any help would be deeply appreciated.