diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.java b/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.java index 616f0d3918..afa3b75319 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.java @@ -123,16 +123,14 @@ public class DefaultInheritanceAssembler for ( Plugin element : src ) { Object key = getPluginKey( element ); - if ( element.isInherited() ) - { - // NOTE: Enforce recursive merge to trigger merging/inheritance logic for executions as well - Plugin plugin = new Plugin(); - plugin.setGroupId( element.getGroupId() ); - plugin.setArtifactId( element.getArtifactId() ); - mergePlugin( plugin, element, sourceDominant, context ); - master.put( key, plugin ); - } + // 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 ); + + master.put( key, plugin ); } Map> predecessors = new LinkedHashMap>(); diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/merge/MavenModelMerger.java b/maven-model-builder/src/main/java/org/apache/maven/model/merge/MavenModelMerger.java index 9a1de0af09..3a1058cd7a 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/merge/MavenModelMerger.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/merge/MavenModelMerger.java @@ -470,7 +470,7 @@ public class MavenModelMerger for ( PluginExecution element : src ) { - if ( sourceDominant || ( source.isInherited() && element.isInherited() ) ) + if ( sourceDominant || ( element.getInherited() != null ? element.isInherited() : source.isInherited() ) ) { Object key = getPluginExecutionKey( element ); merged.put( key, element );