mirror of https://github.com/apache/maven.git
PR: MNG-593
ensure there are no duplicates in the assembled model's dependency list git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@220344 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7073a7c7ad
commit
8c3bbcc397
|
@ -218,9 +218,9 @@ public class MavenProject
|
|||
}
|
||||
}
|
||||
|
||||
public void setDependencies( List denpendencies )
|
||||
public void setDependencies( List dependencies )
|
||||
{
|
||||
model.setDependencies( denpendencies );
|
||||
model.setDependencies( dependencies );
|
||||
}
|
||||
|
||||
public List getDependencies()
|
||||
|
|
|
@ -165,12 +165,22 @@ public class DefaultModelInheritanceAssembler
|
|||
// Dependencies :: aggregate
|
||||
List dependencies = parent.getDependencies();
|
||||
|
||||
for ( Iterator iterator = dependencies.iterator(); iterator.hasNext(); )
|
||||
List childDeps = child.getDependencies();
|
||||
|
||||
Map mappedChildDeps = new TreeMap();
|
||||
for ( Iterator it = childDeps.iterator(); it.hasNext(); )
|
||||
{
|
||||
Dependency dependency = (Dependency) iterator.next();
|
||||
|
||||
child.addDependency( dependency );
|
||||
Dependency dep = (Dependency) it.next();
|
||||
mappedChildDeps.put( dep.getManagementKey(), dep );
|
||||
}
|
||||
|
||||
for ( Iterator it = parent.getDependencies().iterator(); it.hasNext(); )
|
||||
{
|
||||
Dependency dep = (Dependency) it.next();
|
||||
if ( !mappedChildDeps.containsKey( dep.getManagementKey() ) )
|
||||
{
|
||||
child.addDependency( dep );
|
||||
}
|
||||
}
|
||||
|
||||
// Repositories :: aggregate
|
||||
|
|
Loading…
Reference in New Issue