You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "John Casey (JIRA)" <ji...@codehaus.org> on 2009/02/19 21:11:19 UTC

[jira] Closed: (MNG-3228) Maven profile activation does not work when profile is defined in inherited 'parent' pom

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

John Casey closed MNG-3228.
---------------------------

      Assignee: John Casey
    Resolution: Cannot Reproduce

I've tried this with Maven 2.1.0-SNAPSHOT (used to be 2.1.0-M2-SNAPSHOT) on OS X and Windows, using a modified version of the test in the linked issue. I added a profile to the parent to duplicate the user.name trigger, and modified the relativePath of the parent entry in the child POM so it can't traverse that link to reach the parent POM. Then, I installed the parent POM into the local repository, and ran help:active-profiles (from help plugin 2.0.2) on the child. It showed the user.name triggered profile as active.

BTW, I also tried this without a modified relativePath, and it worked. I also ran from the parent POM, and it showed as active in both the parent and the child.

If you can supply a failing test case and detailed instructions to reproduce this error, we can reopen it.

> Maven profile activation does not work when profile is defined in inherited 'parent' pom
> ----------------------------------------------------------------------------------------
>
>                 Key: MNG-3228
>                 URL: http://jira.codehaus.org/browse/MNG-3228
>             Project: Maven 2
>          Issue Type: Bug
>    Affects Versions: 2.0.7
>            Reporter: tony nys
>            Assignee: John Casey
>             Fix For: 2.1.0
>
>
> The goal is to activate a maven profile based on OS user name.
> When I create a standalone project with a profile activation, it works,
> however, when I define the profile in a "parent" pom, it is never activated.
> this works:
> ...
>   <profile>
>     <id>TONY</id>
> <activation>
> <property>
> <name>user.name</name>
> <value>WINTONY</value>
> </property>
> </activation>
>     <properties>
>     </properties>
>    
> So in this case, my profile is activated based on my OS user name
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'help'.
> [INFO] ----------------------------------------------------------------------------
> [INFO] Building Proj1
> [INFO] task-segment: [help:active-profiles] (aggregator-style)
> [INFO] ----------------------------------------------------------------------------
> [INFO] [help:active-profiles]
> [INFO]
> Active Profiles for Project 'com.capgemini.be.proj1:parent:pom:4.0.2':
> The following profiles are active:
>  - TONY (source: pom)
> ------------------
> However, if I now have the profiles definition in the "parent" pom, it doesn't work when I build a child project
> So the child project references the parent pom containing the profiles and the activation, but when it is built,
> the profile is not activated
> PARENT POM:
> ...
>   <profiles>
>   <profile>
>     <id>TONY</id>
> <activation>
> <property>
> <name>user.name</name>
> <value>WINTONY</value>
> </property>
> </activation>
>     <properties>
> ...
> CHILD POM (the one being built)
> <project>
> <parent>
> <groupId>com.capgemini.be.proj1</groupId>
> <artifactId>parent</artifactId>
> <version>4.0.2</version>
> </parent>
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'help'.
> [INFO] ----------------------------------------------------------------------------
> [INFO] Building Proj1 Application
> [INFO] task-segment: [help:active-profiles] (aggregator-style)
> [INFO] ----------------------------------------------------------------------------
> [INFO] [help:active-profiles]
> [INFO]
> Active Profiles for Project 'com.capgemini.be.proj1:proj1-webapp:jar:4.0.2':
> There are no active profiles. 

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