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,13 +189,11 @@ public class DefaultModelInheritanceAssembler
|
||||||
{
|
{
|
||||||
Repository repository = (Repository) iterator.next();
|
Repository repository = (Repository) iterator.next();
|
||||||
|
|
||||||
// parent will always override child repositories
|
// child will always override parent repositories if there are duplicates
|
||||||
// if there are duplicates
|
if ( !childRepositories.contains( repository ) )
|
||||||
if ( childRepositories.contains( repository ) )
|
|
||||||
{
|
{
|
||||||
childRepositories.remove( repository );
|
child.addRepository( repository );
|
||||||
}
|
}
|
||||||
child.addRepository( repository );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mojo Repositories :: aggregate
|
// Mojo Repositories :: aggregate
|
||||||
|
|
|
@ -263,7 +263,8 @@ public class DefaultModelInheritanceAssemblerTest
|
||||||
|
|
||||||
Model child = makeRepositoryModel( "child", "central", "http://repo2.maven.org/maven/" );
|
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 );
|
assembler.assembleModelInheritance( child, parent );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue