mirror of https://github.com/apache/maven.git
PR: MNG-479
child repositories have precedence over parents with the same ID git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@225465 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
740f7ad838
commit
b42c7d3c66
|
@ -189,14 +189,12 @@ public class DefaultModelInheritanceAssembler
|
|||
{
|
||||
Repository repository = (Repository) iterator.next();
|
||||
|
||||
// parent will always override child repositories
|
||||
// if there are duplicates
|
||||
if ( childRepositories.contains( repository ) )
|
||||
// child will always override parent repositories if there are duplicates
|
||||
if ( !childRepositories.contains( repository ) )
|
||||
{
|
||||
childRepositories.remove( repository );
|
||||
}
|
||||
child.addRepository( repository );
|
||||
}
|
||||
}
|
||||
|
||||
// Mojo Repositories :: aggregate
|
||||
List parentPluginRepositories = parent.getPluginRepositories();
|
||||
|
|
|
@ -263,7 +263,8 @@ public class DefaultModelInheritanceAssemblerTest
|
|||
|
||||
Model child = makeRepositoryModel( "child", "central", "http://repo2.maven.org/maven/" );
|
||||
|
||||
List repos = new ArrayList( parent.getRepositories() );
|
||||
// We want to get the child repository here.
|
||||
List repos = new ArrayList( child.getRepositories() );
|
||||
|
||||
assembler.assembleModelInheritance( child, parent );
|
||||
|
||||
|
|
Loading…
Reference in New Issue