[MNG-2103] Inheritance of <plugin> overrides that of <execution>

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@931125 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-04-06 12:44:16 +00:00
parent 37a0e64aa0
commit 997c3110c6
2 changed files with 8 additions and 10 deletions

View File

@ -123,9 +123,8 @@ public class DefaultInheritanceAssembler
for ( Plugin element : src ) for ( Plugin element : src )
{ {
Object key = getPluginKey( element ); Object key = getPluginKey( element );
if ( element.isInherited() )
{ // NOTE: Enforce recursive merge to trigger merging/inheritance logic for executions
// NOTE: Enforce recursive merge to trigger merging/inheritance logic for executions as well
Plugin plugin = new Plugin(); Plugin plugin = new Plugin();
plugin.setGroupId( element.getGroupId() ); plugin.setGroupId( element.getGroupId() );
plugin.setArtifactId( element.getArtifactId() ); plugin.setArtifactId( element.getArtifactId() );
@ -133,7 +132,6 @@ public class DefaultInheritanceAssembler
master.put( key, plugin ); master.put( key, plugin );
} }
}
Map<Object, List<Plugin>> predecessors = new LinkedHashMap<Object, List<Plugin>>(); Map<Object, List<Plugin>> predecessors = new LinkedHashMap<Object, List<Plugin>>();
List<Plugin> pending = new ArrayList<Plugin>(); List<Plugin> pending = new ArrayList<Plugin>();

View File

@ -470,7 +470,7 @@ public class MavenModelMerger
for ( PluginExecution element : src ) for ( PluginExecution element : src )
{ {
if ( sourceDominant || ( source.isInherited() && element.isInherited() ) ) if ( sourceDominant || ( element.getInherited() != null ? element.isInherited() : source.isInherited() ) )
{ {
Object key = getPluginExecutionKey( element ); Object key = getPluginExecutionKey( element );
merged.put( key, element ); merged.put( key, element );