Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
-
Number of attachments :
Description
Since the war plugin does not use the project.xml file for any of its resources, there is not an easy way to filter files. If you are building an artifact that uses maven:copy-resources in one of its goals, filtering is simple. Just set filtering to true on the build resource in the POM, and add a simple preGoal which sets your filters maven.xml This is a lot more difficult when building a war because the files are copied and built into the war in the same goal.
There are some workarounds to this. You can copy the source directory for your webapp to a temporary directory under target and have that be maven.war.src. That requires a lot of verbose code in maven.xml for each webapp. A filtering attribute could be added to the ant:copy command that copies the maven.war.src directory, but then filters cannot be easily defined in the POM.
I added a couple patches which seems to me like a good solution. This allows users to easily include pom resources in their webapp, but by default it is turned off.