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

[jira] (MNG-5369) Inconsistent interaction between activeProfiles and activeByDefault

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

Anthony Whitford commented on MNG-5369:
---------------------------------------

I think I just stumbled on this bug too...  I have a profile defined in the {{settings.xml}} with an {{activeByDefault}} set to {{true}}, then the profile also has some definition in my corporate parent pom.  Despite the {{activeByDefault}}, the profile was not being activated.  I had to add an explicit {{active-profiles}} section to make it work.  But I do think this is a bug because the documentation suggests that {{activeByDefault}} should work fine, {{mvn help:active-profiles}} also reported the profile as active, and this was working fine with Maven 2.2.1.
                
> Inconsistent interaction between activeProfiles and activeByDefault
> -------------------------------------------------------------------
>
>                 Key: MNG-5369
>                 URL: https://jira.codehaus.org/browse/MNG-5369
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles, Settings
>    Affects Versions: 3.0.4
>         Environment: Apache Maven 3.0.4 (r1232337; 2012-01-17 00:44:56-0800)
> Maven home: /home/rchen/dev/tools/apache-maven-3.0.4
> Java version: 1.6.0_26, vendor: Sun Microsystems Inc.
> Java home: /home/rchen/dev/tools/jdk1.6.0_26/jre
> Default locale: en_CA, platform encoding: UTF-8
> OS name: "linux", version: "2.6.36-020636-generic", arch: "amd64", family: "unix"
>            Reporter: Ronald Chen
>         Attachments: maven-active-by-default-parent.tar.gz, maven-profiles-bug.png
>
>
> I have two profiles.  One is activated by activeProfiles in settings.xml and the other is activeByDefault = true
> They are both expected to be active as I am not using -P in my commands.
> The bug is there are some cases in which the activeByDefault profile is not active.
> It seems like whenever both profiles are located in the same pom, the activeByDefault profile is no longer active.  But moving the activeProfiles profile up into a parent pom or moving the activeByDefault profile down to a module both seems to work.
> Its a rather complicated to describe, so I have attached 6 sample projects which illustrates various scenarios.  I've summarized the results in the attached image.
> You can also run all the projects with the command:
> ls -1 | xargs --verbose -I CASE mvn -f CASE/sub-parent/project/pom.xml validate -s CASE/settings.xml |grep -vP '^\[INFO\]'

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