Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Won't Fix
-
2.3
-
None
-
None
-
Apache Maven 2.1.0 (r755702; 2009-03-18 15:10:27-0400)
Java version: 1.6.0_07
Description
I have two files:
src/main/resources/resource.xml
src/test/resources/resource.xml
and following block in the pom.xml:
<build> <resources> <resource> <directory>src/main/resources</directory> </resource> </resources> </build> <profiles> <profile> <id>test</id> <build> <resources> <resource> <directory>src/test/resources</directory> </resource> </resources> </build> </profile> </profiles>
When I run mvn clean package, I want the file from src/main/resources to be packaged. When I run mvn clean package -P test, I want the file from src/test/resources to be packaged. Unfortunately, that doesn't happen. However, when I add filtering to profiled resource:
<profile>
<build>
<resources>
<resource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</profile>
it works. So two questions:
- is it a bug that overriding strategy is triggered by filtering tag?
- if so, which behavior is correct: always override resource or never?