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:
Brett Leslie Porter 2005-07-27 06:20:40 +00:00
parent 740f7ad838
commit b42c7d3c66
2 changed files with 5 additions and 6 deletions

View File

@ -189,13 +189,11 @@ 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 );
}
child.addRepository( repository );
}
// Mojo Repositories :: aggregate

View File

@ -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 );