You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/03/23 21:35:43 UTC

svn commit: r757534 - in /maven/components/trunk/maven-project/src: main/java/org/apache/maven/project/processor/ test/java/org/apache/maven/project/ test/resources-project-builder/inherited-properties-interpolation/ test/resources-project-builder/inhe...

Author: bentmann
Date: Mon Mar 23 20:35:43 2009
New Revision: 757534

URL: http://svn.apache.org/viewvc?rev=757534&view=rev
Log:
[MNG-4102] [regression] Properties used for interpolation of inherited properties can't be customized by child

o Extended UT to check interaction with profile injection as well which is apparently key to reproduce the issue
o Removed interpolation step after profile injection to fix issue

Added:
    maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/   (with props)
    maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/pom.xml   (with props)
    maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/   (with props)
    maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/pom.xml   (with props)
    maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/   (with props)
    maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/pom.xml
      - copied unchanged from r757532, maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/pom.xml
    maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/sub/
      - copied from r757532, maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/sub/
Removed:
    maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/pom.xml
    maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/sub/
Modified:
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/processor/ProcessorContext.java
    maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/processor/ProcessorContext.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/processor/ProcessorContext.java?rev=757534&r1=757533&r2=757534&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/processor/ProcessorContext.java (original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/processor/ProcessorContext.java Mon Mar 23 20:35:43 2009
@@ -90,10 +90,7 @@
         
         Model target = processModelsForInheritance(profileModels, processors, false);
         
-        PomClassicDomainModel m = convertToDomainModel( target, true );
-        interpolateModelProperties(m.getModelProperties(), new ArrayList<InterpolatorProperty>(), m); 
-        
-        return new PomClassicDomainModel(m.getModelProperties(), isMostSpecialized);  
+        return convertToDomainModel( target, isMostSpecialized );
     }
     
     private static Model attachProfileNodesToModel(Profile profile)

Modified: maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java?rev=757534&r1=757533&r2=757534&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java (original)
+++ maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java Mon Mar 23 20:35:43 2009
@@ -1189,16 +1189,25 @@
     }
     //*/
 
-    /* FIXME: MNG-4102*/
-    public void testInheritedPropertiesInterpolatedWithValuesFromChild()
+    /* MNG-4102*/
+    public void testInheritedPropertiesInterpolatedWithValuesFromChildWithoutProfiles()
         throws Exception
     {
-        PomTestWrapper pom = buildPom( "inherited-properties-interpolation/sub" );
+        PomTestWrapper pom = buildPom( "inherited-properties-interpolation/no-profile/sub" );
 
         assertEquals( "CHILD", pom.getValue( "properties/overridden" ) );
         assertEquals( "CHILD", pom.getValue( "properties/interpolated" ) );
     }
-    //*/
+
+    /* MNG-4102 */
+    public void testInheritedPropertiesInterpolatedWithValuesFromChildWithActiveProfiles()
+        throws Exception
+    {
+        PomTestWrapper pom = buildPom( "inherited-properties-interpolation/active-profile/sub" );
+        buildPomFromMavenProject( "inherited-properties-interpolation/active-profile/sub", "it-parent", "it-child" );
+        assertEquals( "CHILD", pom.getValue( "properties/overridden" ) );
+        assertEquals( "CHILD", pom.getValue( "properties/interpolated" ) );
+    }
 
 
     private void assertPathSuffixEquals( String expected, Object actual )

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/
------------------------------------------------------------------------------
    bugtraq:label = Enter issue ID:

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/
------------------------------------------------------------------------------
    bugtraq:message = Issue id: %BUGID%

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/
------------------------------------------------------------------------------
    bugtraq:number = false

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/
------------------------------------------------------------------------------
    bugtraq:url = http://jira.codehaus.org/browse/%BUGID%

Added: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/pom.xml?rev=757534&view=auto
==============================================================================
--- maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/pom.xml (added)
+++ maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/pom.xml Mon Mar 23 20:35:43 2009
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng4102</groupId>
+  <artifactId>parent</artifactId>
+  <version>0.1</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-4102</name>
+  <description>
+    Verify that the effective value of an inherited property reflects the values of any nested property
+    as defined by the child. This boils down to the order of inheritance and (parent) interpolation.
+  </description>
+
+  <properties>
+    <overridden>PARENT</overridden>
+    <!-- Test the effective value of this property in the child when "overridden" is defined by child as well -->
+    <interpolated>${overridden}</interpolated>
+  </properties>
+
+  <profiles>
+    <profile>
+      <id>it-parent</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+    </profile>
+  </profiles>
+</project>

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/
------------------------------------------------------------------------------
    bugtraq:label = Enter issue ID:

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/
------------------------------------------------------------------------------
    bugtraq:message = Issue id: %BUGID%

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/
------------------------------------------------------------------------------
    bugtraq:number = false

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/
------------------------------------------------------------------------------
    bugtraq:url = http://jira.codehaus.org/browse/%BUGID%

Added: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/pom.xml?rev=757534&view=auto
==============================================================================
--- maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/pom.xml (added)
+++ maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/pom.xml Mon Mar 23 20:35:43 2009
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.its.mng4102</groupId>
+    <artifactId>parent</artifactId>
+    <version>0.1</version>
+  </parent>
+
+  <groupId>org.apache.maven.its.mng4102</groupId>
+  <artifactId>test</artifactId>
+  <version>0.1</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-4102 :: Child</name>
+  <description>
+    Verify that the effective value of an inherited property reflects the values of any nested property
+    as defined by the child. This boils down to the order of inheritance and (parent) interpolation.
+  </description>
+
+  <properties>
+    <overridden>CHILD</overridden>
+  </properties>
+
+  <profiles>
+    <profile>
+      <id>it-child</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+    </profile>
+  </profiles>
+</project>

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/
------------------------------------------------------------------------------
    bugtraq:label = Enter issue ID:

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/
------------------------------------------------------------------------------
    bugtraq:message = Issue id: %BUGID%

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/
------------------------------------------------------------------------------
    bugtraq:number = false

Propchange: maven/components/trunk/maven-project/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/
------------------------------------------------------------------------------
    bugtraq:url = http://jira.codehaus.org/browse/%BUGID%