You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Brian Fox (JIRA)" <ji...@codehaus.org> on 2006/05/05 15:10:42 UTC

[jira] Created: (MNG-2275) profiles should be merged when inherited

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


[jira] Updated: (MNG-2275) profiles should be merged when inherited

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter updated MNG-2275:
------------------------------

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

> profiles should be merged when inherited
> ----------------------------------------
>
>                 Key: MNG-2275
>                 URL: http://jira.codehaus.org/browse/MNG-2275
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.0.4
>            Reporter: Brian Fox
>             Fix For: 3.x / Backlog
>
>
> 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

        

[jira] Commented: (MNG-2275) profiles should be merged when inherited

Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2275?page=comments#action_67948 ] 

John Casey commented on MNG-2275:
---------------------------------

profiles aren't designed to be inherited at all, but only injected into the immediate POM they reference...the behaviors from the profile are then passed down via normal POM inheritance. Otherwise, managing a local project's build can become very arcane, since it will have to deal with profiles that magically appear and start mucking with it's behavior. Also, you get into situations of multiple inheritance of the same data if you inject a parent POM, then inherit the profile from parent to child, then inject again in the child. If you only inject in the child, then you have an issue of parent-POM-profiles taking precedence over locally-specified properties and such.

> 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


[jira] Updated: (MNG-2275) profiles should be merged when inherited

Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason van Zyl updated MNG-2275:
-------------------------------

    Fix Version/s:     (was: 3.x)
                   3.0-alpha-7

> profiles should be merged when inherited
> ----------------------------------------
>
>                 Key: MNG-2275
>                 URL: http://jira.codehaus.org/browse/MNG-2275
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.0.4
>            Reporter: Brian Fox
>             Fix For: 3.0-alpha-7
>
>
> 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

        

[jira] Updated: (MNG-2275) profiles should be merged when inherited

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MNG-2275:
-----------------------------------

    Fix Version/s:     (was: 3.0-alpha-8)
                   3.x (to be reviewed)

Even if we wanted to change this, we need to couple this to a model version update or backward-compatibility with existing POM is at danger.

> profiles should be merged when inherited
> ----------------------------------------
>
>                 Key: MNG-2275
>                 URL: http://jira.codehaus.org/browse/MNG-2275
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.0.4
>            Reporter: Brian Fox
>             Fix For: 3.x (to be reviewed)
>
>
> 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

        

[jira] Updated: (MNG-2275) profiles should be merged when inherited

Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2275?page=all ]

John Casey updated MNG-2275:
----------------------------

    Fix Version: 2.1

> 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
>      Fix For: 2.1

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