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/06/08 10:26:12 UTC
[jira] Closed: (MNG-4702) MavenProject.getActiveProfiles() does not
merge active profiles from parent POMs
[ http://jira.codehaus.org/browse/MNG-4702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Bentmann closed MNG-4702.
----------------------------------
Resolution: Not A Bug
Assignee: Benjamin Bentmann
{{MavenProject.getActiveProfiles()}} only holds the profiles from current POM, {{MavenProject.getParent().getActiveProfiles()}} holds the parent profiles.
In Maven 3, {{MavenProject.getInjectedProfileIds()}} can be used to query all relevant profiles at once.
> MavenProject.getActiveProfiles() does not merge active profiles from parent POMs
> --------------------------------------------------------------------------------
>
> Key: MNG-4702
> URL: http://jira.codehaus.org/browse/MNG-4702
> Project: Maven 2 & 3
> Issue Type: Bug
> Affects Versions: 2.2.1, 3.0-beta-1
> Reporter: Lars Corneliussen
> Assignee: Benjamin Bentmann
> Attachments: buggy-profiles.zip
>
>
> Profiles from parent pom's are internally merged, but getActiveProfiles() doesn't return them as long as they aren't redefined in the module.
> The zip contains two poms with some profiles:
> buggy-profiles (activate-me, active-by-default, shared-profile)
> + buggy-module (module-activate-me, module-active-by-default, shared-profile)
> Each of the profiles adds a "echo ..." to the validate-phase.
> {code:title=mvn validate help:active-profiles}
> ------------------------------------------------------------------------
> Building buggy-pom 1.0-SNAPSHOT
> ------------------------------------------------------------------------
> --- exec-maven-plugin:1.1:exec (active-by-default) @ buggy-pom ---
> "### running 'active-by-default'"
> ------------------------------------------------------------------------
> Building buggy-module 1.0-SNAPSHOT
> ------------------------------------------------------------------------
> --- exec-maven-plugin:1.1:exec (active-by-default) @ buggy-module ---
> "### running 'active-by-default'"
> --- exec-maven-plugin:1.1:exec (module-active-by-default) @ buggy-module ---
> "### running 'module-active-by-default'"
> ..
> ..
> Active Profiles for Project 'test:buggy-pom:pom:1.0-SNAPSHOT':
> The following profiles are active:
> - active-by-default (source: pom)
> - netcologne.default (source: settings.xml)
> Active Profiles for Project 'test:buggy-module:pom:1.0-SNAPSHOT':
> The following profiles are active:
> - module-active-by-default (source: pom)
> - netcologne.default (source: settings.xml)
> {code}
> The module should also list 'active-by-default'. Even more since it is also run correctly.
> Explicitely activated profiles behave the same:
> {code}mvn validate help:active-profiles -P activate-me, module-activate-me{code}
> When the a profile is redefined in the module (without any changes) the active-profiles list is correct:
> {code}
> {code}mvn validate help:active-profiles -P activate-me, module-activate-me{code}
--
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