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

Michael Osipov updated MNG-2275:
--------------------------------

    Fix Version/s:     (was: 3.x / Backlog)

> profiles should be merged when inherited
> ----------------------------------------
>
>                 Key: MNG-2275
>                 URL: https://jira.codehaus.org/browse/MNG-2275
>             Project: Maven
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.0.4
>            Reporter: brianfox brianfox
>
> I have some default profiles setup in a super parent pom that all projects 
> inherit from. In some projects I want to change the active profile, but not 
> from the CLI because other projects running in the same multi-project build 
> need to have the normal default. I attempted to work around this by setting 
> the profile to be active on a property in the child pom. See below for parent 
> and child. It appears that when I do this, the child profile replaces the 
> parent. It should be merged so that the properties are pulled from the parent 
> and uses the activation from the child.
> parent:
> <!-- Setup default profiles. -->
> <profiles>
>       <profile>
>               <id>dev</id>
>               <properties>
>                       
> <profile-default.values>src/main/filters/dev-default.values</profile-default.values>
>               </properties>                   
>       </profile>
>       <profile>
>               <id>auto-test</id>
>               <properties>
>                       
> <profile-default.values>src/main/filters/auto-test-default.values</profile-default.values>
>               </properties>                   
>       </profile>
>       <profile>
>               <id>man-test</id>
>               <properties>
>                       
> <profile-default.values>src/main/filters/man-test-default.values</profile-default.values>
>               </properties>                   
>       </profile>
>       <profile>
>               <id>prod</id>
>               <properties>
>                       
> <profile-default.values>src/main/filters/prod-default.values</profile-default.values>
>               </properties>                   
>       </profile>
> </profiles>
>  
>  
> child pom..
>  
>    <!--  This is the property to override for custom properties in this 
> project-->
>   <properties>
>         
> <client-ct-package.values>${user.default.values}</client-ct-package.values>
>   </properties>
>   <build>
>     <filters>
>       <filter>${profile-default.values}</filter>
>       <filter>${user.default.values}</filter>
>       <filter>${client-ct-package.values}</filter>
>     </filters>
>     <resources>
>       <resource>
>         <directory>src/main/resources</directory>
>         <filtering>true</filtering>
>       </resource>
>     </resources>
>   </build>
>    <!-- temporary to activate the CT production values until all projects can 
> have prod values -->
>     <profiles>
>      <profile>
>       <id>prod</id>
>       <activation>
>           <property>
>              <name>deploy-ct</name>
>           </property>
>       </activation>



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to