[ 
https://issues.apache.org/jira/browse/MNG-5127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sylwester Lachiewicz reassigned MNG-5127:
-----------------------------------------

    Assignee: Sylwester Lachiewicz  (was: John Dennis Casey)

> CLONE - Maven profile activation does not work when profile is defined in 
> inherited 'parent' pom
> ------------------------------------------------------------------------------------------------
>
>                 Key: MNG-5127
>                 URL: https://issues.apache.org/jira/browse/MNG-5127
>             Project: Maven
>          Issue Type: Bug
>            Reporter: Scokart Gilles
>            Assignee: Sylwester Lachiewicz
>            Priority: Major
>         Attachments: daddy.zip, daddy2.zip
>
>
> 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:
> {code:xml}
> ...
>   <profile>
>     <id>TONY</id>
> <activation>
> <property>
> <name>user.name</name>
> <value>WINTONY</value>
> </property>
> </activation>
>     <properties>
>     </properties>
> {code}
>    
> So in this case, my profile is activated based on my OS user name
> {noformat}
> [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)
> {noformat}
> ------------------
> 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
> {code:xml|title=PARENT POM}
> ...
>   <profiles>
>   <profile>
>     <id>TONY</id>
> <activation>
> <property>
> <name>user.name</name>
> <value>WINTONY</value>
> </property>
> </activation>
>     <properties>
> ...
> {code}
> {code:xml|title=CHILD POM (the one being built)}
> <project>
> <parent>
> <groupId>com.capgemini.be.proj1</groupId>
> <artifactId>parent</artifactId>
> <version>4.0.2</version>
> </parent>
> {code}
> {noformat}
> [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. 
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to