o when creating a dependency artifact, why not use a dependency as a parameter!

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@751137 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2009-03-06 23:34:03 +00:00
parent 90aa85b340
commit 2a515cdb5a
3 changed files with 6 additions and 20 deletions

View File

@ -1528,7 +1528,7 @@ public class MavenProject
{
Dependency d = i.next();
Artifact artifact = repositorySystem.createDependencyArtifact( d.getGroupId(), d.getArtifactId(), d.getVersion(), d.getType(), d.getClassifier(), d.getScope(), d.isOptional() );
Artifact artifact = repositorySystem.createDependencyArtifact( d );
if ( artifact == null )
{

View File

@ -118,34 +118,19 @@ public class LegacyMavenRepositorySystem
return artifactFactory.createProjectArtifact( groupId, artifactId, metaVersionId );
}
public Artifact createDependencyArtifact( String groupId, String artifactId, String version, String type, String classifier, String scope, boolean optional )
public Artifact createDependencyArtifact( Dependency d )
{
VersionRange versionRange;
try
{
versionRange = VersionRange.createFromVersionSpec( version );
versionRange = VersionRange.createFromVersionSpec( d.getVersion() );
}
catch ( InvalidVersionSpecificationException e )
{
return null;
}
return artifactFactory.createDependencyArtifact( groupId, artifactId, versionRange, type, classifier, scope );
}
public Artifact createDependencyArtifact( String groupId, String artifactId, String version, String type, String classifier, String scope, String inheritedScope )
{
VersionRange versionRange;
try
{
versionRange = VersionRange.createFromVersionSpec( version );
}
catch ( InvalidVersionSpecificationException e )
{
return null;
}
return artifactFactory.createDependencyArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope );
return artifactFactory.createDependencyArtifact( d.getGroupId(), d.getArtifactId(), versionRange, d.getType(), d.getClassifier(), d.getScope() );
}
public Artifact createExtensionArtifact( String groupId, String artifactId, String version )

View File

@ -48,7 +48,8 @@ public interface MavenRepositorySystem
Artifact createPluginArtifact( String groupId, String artifactId, String version );
Artifact createDependencyArtifact( String groupId, String artifactId, String version, String type, String classifier, String scope, boolean optional );
// This is still only used in one place.
Artifact createDependencyArtifact( Dependency dependency );
//REMOVE
// This will disappear when we actually deal with resolving a root dependency and its dependencies. This is used everywhere because of that