Author: brett
Date: Thu Feb 26 13:37:50 2009
New Revision: 748146

URL: http://svn.apache.org/viewvc?rev=748146&view=rev
Log:
[MNG-3811] Report plugins don't inherit configuration
Submitted by: Nik Everett

Modified:
    
maven/components/branches/maven-2.1.x/maven-project/src/main/java/org/apache/maven/project/ModelUtils.java
    
maven/components/branches/maven-2.1.x/maven-project/src/test/java/org/apache/maven/project/ModelUtilsTest.java

Modified: 
maven/components/branches/maven-2.1.x/maven-project/src/main/java/org/apache/maven/project/ModelUtils.java
URL: 
http://svn.apache.org/viewvc/maven/components/branches/maven-2.1.x/maven-project/src/main/java/org/apache/maven/project/ModelUtils.java?rev=748146&r1=748145&r2=748146&view=diff
==============================================================================
--- 
maven/components/branches/maven-2.1.x/maven-project/src/main/java/org/apache/maven/project/ModelUtils.java
 (original)
+++ 
maven/components/branches/maven-2.1.x/maven-project/src/main/java/org/apache/maven/project/ModelUtils.java
 Thu Feb 26 13:37:50 2009
@@ -798,11 +798,22 @@
             child.setVersion( parent.getVersion() );
         }
 
-        // from here to the end of the method is dealing with merging of the 
<executions/> section.
         String parentInherited = parent.getInherited();
 
         boolean parentIsInherited = ( parentInherited == null ) || 
Boolean.valueOf( parentInherited ).booleanValue();
 
+        // merge configuration just like with build plugins    
+        if ( parentIsInherited )
+        {
+            Xpp3Dom childConfiguration = (Xpp3Dom) child.getConfiguration();
+            Xpp3Dom parentConfiguration = (Xpp3Dom) parent.getConfiguration();
+
+            childConfiguration = Xpp3Dom.mergeXpp3Dom( childConfiguration, 
parentConfiguration );
+
+            child.setConfiguration( childConfiguration );
+        }
+
+        // from here to the end of the method is dealing with merging of the 
<executions/> section.
         List parentReportSets = parent.getReportSets();
 
         if ( ( parentReportSets != null ) && !parentReportSets.isEmpty() )

Modified: 
maven/components/branches/maven-2.1.x/maven-project/src/test/java/org/apache/maven/project/ModelUtilsTest.java
URL: 
http://svn.apache.org/viewvc/maven/components/branches/maven-2.1.x/maven-project/src/test/java/org/apache/maven/project/ModelUtilsTest.java?rev=748146&r1=748145&r2=748146&view=diff
==============================================================================
--- 
maven/components/branches/maven-2.1.x/maven-project/src/test/java/org/apache/maven/project/ModelUtilsTest.java
 (original)
+++ 
maven/components/branches/maven-2.1.x/maven-project/src/test/java/org/apache/maven/project/ModelUtilsTest.java
 Thu Feb 26 13:37:50 2009
@@ -193,8 +193,7 @@
         Xpp3Dom result3Config = (Xpp3Dom) result3.getConfiguration();
 
         assertNotNull( result3Config );
-        // Carlos: Current behavior is not to merge the ocnfiguration, 
although dont know why 
-        assertNull( result3Config.getChild( "key" ) );
+        assertNotNull( result3Config.getChild( "key" ) );
         assertNotNull( result3Config.getChild( "key2" ) );
 
         //assertEquals( "value", result3Config.getChild( "key" ).getValue() );


Reply via email to