profiles should be merged when inherited
----------------------------------------

         Key: MNG-2275
         URL: http://jira.codehaus.org/browse/MNG-2275
     Project: Maven 2
        Type: Bug

  Components: Inheritence and Interpolation  
    Versions: 2.0.4    
    Reporter: Brian Fox


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

Reply via email to