maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r945294 - /maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.java
Date Mon, 17 May 2010 18:39:46 GMT
Author: bentmann
Date: Mon May 17 18:39:46 2010
New Revision: 945294

URL: http://svn.apache.org/viewvc?rev=945294&view=rev
Log:
[MNG-4677] [regression] Plugin configuration incorrectly inherited from parent pom

Modified:
    maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.java

Modified: maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.java?rev=945294&r1=945293&r2=945294&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.java
(original)
+++ maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.java
Mon May 17 18:39:46 2010
@@ -122,15 +122,18 @@ public class DefaultInheritanceAssembler
 
                 for ( Plugin element : src )
                 {
-                    Object key = getPluginKey( element );
+                    if ( element.isInherited() || !element.getExecutions().isEmpty() )
+                    {
+                        // NOTE: Enforce recursive merge to trigger merging/inheritance logic
for executions
+                        Plugin plugin = new Plugin();
+                        plugin.setGroupId( element.getGroupId() );
+                        plugin.setArtifactId( element.getArtifactId() );
+                        mergePlugin( plugin, element, sourceDominant, context );
 
-                    // NOTE: Enforce recursive merge to trigger merging/inheritance logic
for executions
-                    Plugin plugin = new Plugin();
-                    plugin.setGroupId( element.getGroupId() );
-                    plugin.setArtifactId( element.getArtifactId() );
-                    mergePlugin( plugin, element, sourceDominant, context );
+                        Object key = getPluginKey( element );
 
-                    master.put( key, plugin );
+                        master.put( key, plugin );
+                    }
                 }
 
                 Map<Object, List<Plugin>> predecessors = new LinkedHashMap<Object,
List<Plugin>>();
@@ -174,6 +177,21 @@ public class DefaultInheritanceAssembler
         }
 
         @Override
+        protected void mergePlugin( Plugin target, Plugin source, boolean sourceDominant,
Map<Object, Object> context )
+        {
+            if ( source.isInherited() )
+            {
+                mergeConfigurationContainer( target, source, sourceDominant, context );
+            }
+            mergePlugin_GroupId( target, source, sourceDominant, context );
+            mergePlugin_ArtifactId( target, source, sourceDominant, context );
+            mergePlugin_Version( target, source, sourceDominant, context );
+            mergePlugin_Extensions( target, source, sourceDominant, context );
+            mergePlugin_Dependencies( target, source, sourceDominant, context );
+            mergePlugin_Executions( target, source, sourceDominant, context );
+        }
+
+        @Override
         protected void mergeReporting_Plugins( Reporting target, Reporting source, boolean
sourceDominant,
                                                Map<Object, Object> context )
         {



Mime
View raw message