From 59871b0ee710acb39058ea418272c47b705cbdec Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Fri, 30 Oct 2009 18:13:26 +0000 Subject: [PATCH] o Fixed backward-compat git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@831410 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/project/MavenProject.java | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java index 25337253b6..7ed5f7cba3 100644 --- a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java +++ b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java @@ -25,7 +25,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; -import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Properties; @@ -64,6 +63,8 @@ import org.apache.maven.model.Repository; import org.apache.maven.model.Resource; import org.apache.maven.model.Scm; import org.apache.maven.model.io.xpp3.MavenXpp3Writer; +import org.apache.maven.project.artifact.InvalidDependencyVersionException; +import org.apache.maven.project.artifact.MavenMetadataSource; import org.apache.maven.repository.RepositorySystem; import org.codehaus.plexus.classworlds.realm.ClassRealm; import org.codehaus.plexus.util.StringUtils; @@ -237,22 +238,9 @@ public class MavenProject //TODO: need to integrate the effective scope and refactor it out of the MMS @Deprecated public Set createArtifacts( ArtifactFactory artifactFactory, String inheritedScope, ArtifactFilter filter ) + throws InvalidDependencyVersionException { - Set artifacts = new LinkedHashSet(); - - for ( Dependency d : getDependencies() ) - { - Artifact dependencyArtifact = - repositorySystem.createArtifact( d.getGroupId(), d.getArtifactId(), d.getVersion(), d.getScope(), - d.getType() ); - - if ( filter == null || filter.include( dependencyArtifact ) ) - { - artifacts.add( dependencyArtifact ); - } - } - - return artifacts; + return MavenMetadataSource.createArtifacts( artifactFactory, getDependencies(), inheritedScope, filter, this ); } // TODO: Find a way to use here...it's tricky, because the moduleProject