diff --git a/maven-project/src/main/java/org/apache/maven/project/ModelUtils.java b/maven-project/src/main/java/org/apache/maven/project/ModelUtils.java index ba61f9ac5b..f6e424e972 100644 --- a/maven-project/src/main/java/org/apache/maven/project/ModelUtils.java +++ b/maven-project/src/main/java/org/apache/maven/project/ModelUtils.java @@ -587,7 +587,7 @@ public final class ModelUtils Build clone = new Build(); - assembler.assembleBuildInheritance( clone, build ); + assembler.assembleBuildInheritance( clone, build, false ); return clone; } diff --git a/maven-project/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java b/maven-project/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java index b879a2f5a8..ce45ad50f3 100644 --- a/maven-project/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java +++ b/maven-project/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java @@ -291,14 +291,15 @@ public class DefaultModelInheritanceAssembler child.setBuild( childBuild ); } - assembleBuildInheritance( childBuild, parentBuild ); + assembleBuildInheritance( childBuild, parentBuild, true ); } } // TODO: Remove this! @SuppressWarnings("unchecked") public void assembleBuildInheritance( Build childBuild, - Build parentBuild ) + Build parentBuild, + boolean handleAsInheritance ) { // The build has been set but we want to step in here and fill in // values that have not been set by the child. @@ -361,7 +362,7 @@ public class DefaultModelInheritanceAssembler } // Plugins are aggregated if Plugin.inherit != false - ModelUtils.mergePluginLists( childBuild, parentBuild, true ); + ModelUtils.mergePluginLists( childBuild, parentBuild, handleAsInheritance ); // Plugin management :: aggregate PluginManagement dominantPM = childBuild.getPluginManagement(); diff --git a/maven-project/src/main/java/org/apache/maven/project/inheritance/ModelInheritanceAssembler.java b/maven-project/src/main/java/org/apache/maven/project/inheritance/ModelInheritanceAssembler.java index 6ffb3c305c..6f6f076bca 100644 --- a/maven-project/src/main/java/org/apache/maven/project/inheritance/ModelInheritanceAssembler.java +++ b/maven-project/src/main/java/org/apache/maven/project/inheritance/ModelInheritanceAssembler.java @@ -35,7 +35,8 @@ public interface ModelInheritanceAssembler void assembleModelInheritance( Model child, Model parent ); void assembleBuildInheritance( Build childBuild, - Build parentBuild ); + Build parentBuild, + boolean handleAsInheriance ); void copyModel( Model dest, Model source ); }