Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.7
-
Fix Version/s: None
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
When I invoke Maven as follows:
mvn package -Dmy.test.property="from commandline" -Ptest-profile
Setting my.test.property on the command line, I expect to see the following output from the testcase:
[echo] pom.xml: ptest = from commandline
[echo] pom.xml: my.test.property = from commandline
[echo] build.xml: ptest = from commandline
[echo] build.xml: my.test.property = from commandline
But instead I see:
[echo] pom.xml: ptest = from commandline
[echo] pom.xml: my.test.property = from commandline
[echo] build.xml: ptest = from commandline
[echo] build.xml: my.test.property = from profile
It looks like the <ant> task is causing properties set on the command line to not be inherited.
When run without -Ptest-profile, the expected output is seen. The comments on MANTRUN-121 would seem to imply that properties set on the commandline should always be passed to sub <ant> builds, regardless of the value of the inheritAll property.
I've tested with a profile in the pom as well as in settings.xml, and the same behavior is observed regardless of where the profile is, so long as it is activated.
Workaround: In a dummy profile, define a property like this:
<profile> <id>ts.ipv6.dummy.node1</id> <activation><property><name>node1</name></property></activation> <properties> <node1>${node1}</node1> </properties> </profile>Ant plugin will buy that.