Hello,
I have properties in a POM file I need to be able to override with
command line –D option,
to run build in a different environments. How can I do this? Simple
example below doesn't work
as I expect it should, i.e. test.txt will contain FALSE after running
c:\temp\module> mvn -Dtest.result=PASS process-test-resources
What am I doing in a wrong way?
Sample project:
----------------------
module/pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<properties>
<test.result>FAIL</test.result>
</properties>
<build>
<testResources>
<testResource>
<directory>${basedir}/src/test/resources</directory>
<filtering>true</filtering>
<includes>
<include>*.txt</include>
</includes>
</testResource>
</testResources>
</build>
</project>
module/src/test/resources/test.txt
This test ${test.result}
--
Igor.