git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@191800 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-06-22 11:24:31 +00:00
parent c3d0ba0846
commit 677a0dd7d5
1 changed files with 14 additions and 6 deletions

View File

@ -159,15 +159,23 @@ public class DefaultMavenProjectBuilder
private Map createManagedVersionMap( DependencyManagement dependencyManagement )
{
Map map = new HashMap();
for ( Iterator i = dependencyManagement.getDependencies().iterator(); i.hasNext(); )
Map map;
if ( dependencyManagement != null && dependencyManagement.getDependencies() != null )
{
Dependency d = (Dependency) i.next();
map = new HashMap();
for ( Iterator i = dependencyManagement.getDependencies().iterator(); i.hasNext(); )
{
Dependency d = (Dependency) i.next();
Artifact artifact = artifactFactory.createArtifact( d.getGroupId(), d.getArtifactId(), d.getVersion(),
d.getScope(), d.getType(), null );
Artifact artifact = artifactFactory.createArtifact( d.getGroupId(), d.getArtifactId(), d.getVersion(),
d.getScope(), d.getType(), null );
map.put( d.getManagementKey(), artifact );
map.put( d.getManagementKey(), artifact );
}
}
else
{
map = Collections.EMPTY_MAP;
}
return map;
}