You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org> on 2010/07/27 20:37:32 UTC

[jira] Updated: (MNG-4741) Priority for profiles activated by property or -P unclear

     [ http://jira.codehaus.org/browse/MNG-4741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MNG-4741:
-----------------------------------

    Attachment: pom.xml

Running {{mvn validate -P override}} on the attached POM yields:
{noformat}
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Integration Test :: MNG-4741 - OVERRIDE
{noformat}
i.e. the property {{test}} used in the project name evalutes to {{OVERRIDE}} as you expect and it should (i.e. active profiles are injected in order of declaration, last in wins).

Since you mentioned Hudson, I can only suggest to double-check the unexpected behavior is not caused by Hudson's Maven integration. Using a stock Maven 2.0.9 distribution (and all later versions), I cannot reproduce the issue.

> Priority for profiles activated by property or -P unclear
> ---------------------------------------------------------
>
>                 Key: MNG-4741
>                 URL: http://jira.codehaus.org/browse/MNG-4741
>             Project: Maven 2 & 3
>          Issue Type: Bug
>    Affects Versions: 2.0.9
>            Reporter: Andreas Ebbert-Karroum
>            Priority: Minor
>         Attachments: pom.xml
>
>
> I could not find the situation documented somewhere, but the current behaviour is against my excpectation, hence a low priority bug report. In my pom, I have two profiles. One is activated by the -P command line option, the other by an environment variable. In variation of the example in MNG-2309:
> {code:xml}
> <profile>
>   <id>default</id>
>   <activation>
>     <property>
>       <name>env.WORKSPACE</name>
>     </property>
>   </activation>
>   <properties>
>     <test>DEFAULT</test>
>   </properties>
> </profile>
> <profile>
>   <id>override</id>
>   <properties>
>     <test>OVERRIDE</test>
>   </properties>
> </profile>
> {code}
> env.WORKSPACE is set by Hudson, when the build is executed. When Hudson runs "mvn -P override" I would expect test set to override. As I said, this is my expectation, and I don't know if it was a consious design decision to make the priority of profile activation differently.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira