You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Ronny Pscheidl (JIRA)" <ji...@codehaus.org> on 2013/01/17 13:22:13 UTC

[jira] (MNG-4565) Multiple profile activation conditions does not work

    [ https://jira.codehaus.org/browse/MNG-4565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=317477#comment-317477 ] 

Ronny Pscheidl commented on MNG-4565:
-------------------------------------

This extension should solve the problem when all activation conditions are met:

https://github.com/johnjcool/and-activation-profile-selector
                
> Multiple profile activation conditions does not work
> ----------------------------------------------------
>
>                 Key: MNG-4565
>                 URL: https://jira.codehaus.org/browse/MNG-4565
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.2.1
>         Environment: All platforms.
>            Reporter: Nicholas Allen
>            Assignee: Brian Fox
>             Fix For: Issues to be reviewed for 3.x
>
>
> According to the documentation at http://www.sonatype.com/books/mvnref-book/reference/profiles-sect-activation.html a profile is activated when all activation conditions are met (which makes sense of course). But when I try to use this it does not work. It seems maven does an OR instead of an AND (which is not rearly as useful and is the opposite of what the documentation says at the previous link).
> For example, if I have one profile that is activated like this:
>          <activation>
>             <activeByDefault>false</activeByDefault>
>             <os>
>                <name>linux</name>
>             </os>
>          </activation>
> and another profile that is activated like this:
>         <activation>
>             <activeByDefault>false</activeByDefault>
>             <os>
>                <name>linux</name>
>             </os>
>             <property>
>                 <name>release</name>
>                 <value>true</value>
>             </property>
>          </activation>
> Then I would expect the second profile to only be activated if the OS is linux and the release property is defined.
> When I run 'mvn help:active-profiles' however, maven shows that both profiles are active even though the release property is not defined.

--
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