You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Derek Lewis (JIRA)" <ji...@codehaus.org> on 2011/12/09 00:14:39 UTC
[jira] Created: (MANTRUN-172) Properties passed to Maven as -D
don't get passed to invocations when a profile sets the same property
Properties passed to Maven as -D don't get passed to <ant> invocations when a profile sets the same property
------------------------------------------------------------------------------------------------------------
Key: MANTRUN-172
URL: https://jira.codehaus.org/browse/MANTRUN-172
Project: Maven 2.x Antrun Plugin
Issue Type: Bug
Affects Versions: 1.7
Reporter: Derek Lewis
Attachments: maven-antrun-plugin-bug.zip
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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (MANTRUN-172) Properties passed to Maven as -D don't get
passed to invocations when a profile sets the same property
Posted by "Ondrej Zizka (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/MANTRUN-172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=293555#comment-293555 ]
Ondrej Zizka commented on MANTRUN-172:
--------------------------------------
Workaround: In a dummy profile, define a property like this:
{code}
<profile>
<id>ts.ipv6.dummy.node1</id>
<activation><property><name>node1</name></property></activation>
<properties> <node1>${node1}</node1> </properties>
</profile>
{code}
Ant plugin will buy that.
> Properties passed to Maven as -D don't get passed to <ant> invocations when a profile sets the same property
> ------------------------------------------------------------------------------------------------------------
>
> Key: MANTRUN-172
> URL: https://jira.codehaus.org/browse/MANTRUN-172
> Project: Maven 2.x Antrun Plugin
> Issue Type: Bug
> Affects Versions: 1.7
> Reporter: Derek Lewis
> Attachments: maven-antrun-plugin-bug.zip
>
>
> 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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira