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

Gilles Scokart commented on MNG-5127:
-------------------------------------

Actually, it is.

In my [grand]-parent pom, I have a profile always active.  When I run in my 
sub-prjoect mvn help:all-profiles, I see the profile as being inactive.  But if 
I run the build, the plugin of my profile are being executed.

However, if I specify an other profile with -P on the comand line, the 'always' 
active profile is not active anymore.

I'm not sure anymore what is feature and what is not.  I think there is at 
least an issue in the help plugin.  If the plugin defined in the profile will 
be executed, I think they should be listed as active.

The other (maybe as designed) issue is that providing a profile with -P disable 
the profile supposed to be always active.

> CLONE - Maven profile activation does not work when profile is defined in 
> inherited 'parent' pom
> ------------------------------------------------------------------------------------------------
>
>                 Key: MNG-5127
>                 URL: https://jira.codehaus.org/browse/MNG-5127
>             Project: Maven 2 & 3
>          Issue Type: Bug
>            Reporter: Gilles Scokart
>            Assignee: John Casey
>
> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to