From eedd050414642713791503e9ca684be453d51622 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Wed, 27 Jul 2005 14:17:41 +0000 Subject: [PATCH] PR: MNG-649 add classifier to dependency. it becomes part of the dependency key along with type when not null git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@225524 13f79535-47bb-0310-9956-ffa450edef68 --- .../artifact/factory/ArtifactFactory.java | 4 +- .../factory/DefaultArtifactFactory.java | 8 +- .../DefaultArtifactCollectorTest.java | 9 +- maven-model/maven.mdo | 17 ++-- .../plugin/release/PrepareReleaseMojo.java | 90 ++++++++++--------- .../transformer/VersionTransformer.java | 11 ++- .../project/DefaultMavenProjectBuilder.java | 77 +++++++++------- .../apache/maven/project/MavenProject.java | 5 +- .../project/artifact/MavenMetadataSource.java | 8 +- .../maven/project/TestArtifactResolver.java | 7 +- 10 files changed, 133 insertions(+), 103 deletions(-) diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/factory/ArtifactFactory.java b/maven-artifact/src/main/java/org/apache/maven/artifact/factory/ArtifactFactory.java index e85bfaec0c..d0ac270135 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/factory/ArtifactFactory.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/factory/ArtifactFactory.java @@ -42,10 +42,10 @@ public interface ArtifactFactory String classifier ); Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type, - String scope ); + String classifier, String scope ); Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type, - String scope, String inheritedScope ); + String classifier, String scope, String inheritedScope ); Artifact createBuildArtifact( String groupId, String artifactId, String version, String packaging ); diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java b/maven-artifact/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java index ac131ea73f..7c7b4e6db2 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java @@ -50,15 +50,15 @@ public class DefaultArtifactFactory } public Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type, - String scope ) + String classifier, String scope ) { - return createArtifact( groupId, artifactId, versionRange, null, type, null, null ); + return createArtifact( groupId, artifactId, versionRange, null, type, classifier, null ); } public Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type, - String scope, String inheritedScope ) + String classifier, String scope, String inheritedScope ) { - return createArtifact( groupId, artifactId, versionRange, scope, type, null, inheritedScope ); + return createArtifact( groupId, artifactId, versionRange, scope, type, classifier, inheritedScope ); } public Artifact createBuildArtifact( String groupId, String artifactId, String version, String packaging ) diff --git a/maven-artifact/src/test/java/org/apache/maven/artifact/resolver/DefaultArtifactCollectorTest.java b/maven-artifact/src/test/java/org/apache/maven/artifact/resolver/DefaultArtifactCollectorTest.java index b6dda0e622..422a104105 100644 --- a/maven-artifact/src/test/java/org/apache/maven/artifact/resolver/DefaultArtifactCollectorTest.java +++ b/maven-artifact/src/test/java/org/apache/maven/artifact/resolver/DefaultArtifactCollectorTest.java @@ -419,8 +419,10 @@ public class DefaultArtifactCollectorTest ArtifactSpec a = (ArtifactSpec) artifacts.get( key ); try { - return new ResolutionGroup( artifact, createArtifacts( artifactFactory, a.dependencies, artifact.getScope(), - artifact.getDependencyFilter() ), Collections.EMPTY_LIST ); + return new ResolutionGroup( artifact, createArtifacts( artifactFactory, a.dependencies, + artifact.getScope(), + artifact.getDependencyFilter() ), + Collections.EMPTY_LIST ); } catch ( InvalidVersionSpecificationException e ) { @@ -445,7 +447,8 @@ public class DefaultArtifactCollectorTest VersionRange versionRange = VersionRange.createFromVersionSpec( d.getVersion() ); Artifact artifact = artifactFactory.createDependencyArtifact( d.getGroupId(), d.getArtifactId(), - versionRange, d.getType(), d.getScope(), + versionRange, d.getType(), + d.getClassifier(), d.getScope(), inheritedScope ); if ( artifact != null && ( dependencyFilter == null || dependencyFilter.include( artifact ) ) ) diff --git a/maven-model/maven.mdo b/maven-model/maven.mdo index 812a451b19..887027e699 100644 --- a/maven-model/maven.mdo +++ b/maven-model/maven.mdo @@ -1210,6 +1210,16 @@ String jar + + classifier + 4.0.0 + + The classifier of the dependency. This allows distinguishing two artifacts that belong to the same POM but + were built differently, and is appended to the filename after the version. + + String + false + properties 3.0.0 @@ -1266,14 +1276,9 @@ 4.0.0 diff --git a/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PrepareReleaseMojo.java b/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PrepareReleaseMojo.java index c995d6845b..500dc9fb6c 100644 --- a/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PrepareReleaseMojo.java +++ b/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PrepareReleaseMojo.java @@ -74,21 +74,21 @@ public class PrepareReleaseMojo * @readonly */ private boolean interactive = true; - + /** * @parameter expression="${component.org.apache.maven.artifact.metadata.ArtifactMetadataSource}" * @required * @readonly */ private ArtifactMetadataSource artifactMetadataSource; - + /** * @parameter expression="${component.org.codehaus.plexus.components.inputhandler.InputHandler}" * @required * @readonly */ private InputHandler inputHandler; - + /** * @parameter expression="${localRepository}" * @required @@ -122,23 +122,24 @@ public class PrepareReleaseMojo checkForPresenceOfSnapshots(); transformPomToReleaseVersionPom(); - + generateReleasePropertiesFile(); - + generateReleasePom(); - + checkInReleaseVersionPom(); tagRelease(); transformPomToSnapshotVersionPom(); - + new File( basedir, RELEASE_POM ).delete(); checkInSnapshotVersionPom(); } - private void generateReleasePropertiesFile() throws MojoExecutionException + private void generateReleasePropertiesFile() + throws MojoExecutionException { try { @@ -349,29 +350,30 @@ public class PrepareReleaseMojo if ( project.hasParent() ) { Artifact parentArtifact = project.getParentArtifact(); - + if ( isSnapshot( parentArtifact.getBaseVersion() ) ) { String version = resolveVersion( parentArtifact, "parent" ); - + model.getParent().setVersion( version ); } } - + //Rewrite dependencies section Map artifactMap = ArtifactUtils.artifactMapByArtifactId( project.getArtifacts() ); - + for ( Iterator i = model.getDependencies().iterator(); i.hasNext(); ) { Dependency dep = (Dependency) i.next(); - - String conflictId = ArtifactUtils.artifactId( dep.getGroupId(), dep.getArtifactId(), dep.getType(), dep.getVersion() ); - + + String conflictId = ArtifactUtils.artifactId( dep.getGroupId(), dep.getArtifactId(), dep.getType(), + dep.getClassifier(), dep.getVersion() ); + Artifact artifact = (Artifact) artifactMap.get( conflictId ); - + dep.setVersion( artifact.getVersion() ); } - + try { PomTransformer transformer = new VersionTransformer(); @@ -391,43 +393,45 @@ public class PrepareReleaseMojo throw new MojoExecutionException( "Can't transform pom to its release version form.", e ); } } - - private void generateReleasePom() throws MojoExecutionException + + private void generateReleasePom() + throws MojoExecutionException { MavenProject releaseProject = new MavenProject( project ); Model releaseModel = releaseProject.getModel(); - + //Rewrite parent version if ( project.hasParent() ) { Artifact parentArtifact = project.getParentArtifact(); - + if ( isSnapshot( parentArtifact.getBaseVersion() ) ) { String version = resolveVersion( parentArtifact, "parent" ); - + model.getParent().setVersion( version ); } } //Rewrite dependencies section List newdeps = new ArrayList(); - + for ( Iterator i = releaseProject.getArtifacts().iterator(); i.hasNext(); ) { Artifact artifact = (Artifact) i.next(); - + Dependency newdep = new Dependency(); - + newdep.setArtifactId( artifact.getArtifactId() ); newdep.setGroupId( artifact.getGroupId() ); newdep.setVersion( artifact.getVersion() ); newdep.setType( artifact.getType() ); newdep.setScope( artifact.getScope() ); - + newdep.setClassifier( artifact.getClassifier() ); + newdeps.add( newdep ); } - + releaseModel.setDependencies( newdeps ); //Rewrite plugins version @@ -439,17 +443,17 @@ public class PrepareReleaseMojo for ( Iterator j = releaseModel.getBuild().getPlugins().iterator(); j.hasNext(); ) { Plugin plugin = (Plugin) j.next(); - if ( ArtifactUtils.versionlessKey(artifact).equals( plugin.getKey() ) ) + if ( ArtifactUtils.versionlessKey( artifact ).equals( plugin.getKey() ) ) { String version = resolveVersion( artifact, "plugin" ); - + plugin.setGroupId( artifact.getGroupId() ); plugin.setVersion( version ); } } } } - + //Rewrite report version for ( Iterator i = releaseProject.getReportArtifacts().iterator(); i.hasNext(); ) { @@ -457,16 +461,16 @@ public class PrepareReleaseMojo if ( isSnapshot( artifact.getBaseVersion() ) ) { List reportPlugins = releaseProject.getReportPlugins(); - + if ( reportPlugins != null ) { for ( Iterator j = reportPlugins.iterator(); j.hasNext(); ) { ReportPlugin plugin = (ReportPlugin) j.next(); - if ( ArtifactUtils.versionlessKey(artifact).equals( plugin.getKey() ) ) + if ( ArtifactUtils.versionlessKey( artifact ).equals( plugin.getKey() ) ) { String version = resolveVersion( artifact, "report" ); - + plugin.setGroupId( artifact.getGroupId() ); plugin.setVersion( version ); } @@ -474,15 +478,15 @@ public class PrepareReleaseMojo } } } - + File releasePomFile = new File( basedir, RELEASE_POM ); - + Writer writer = null; - + try { writer = new FileWriter( releasePomFile ); - + releaseProject.writeModel( writer ); } catch ( IOException e ) @@ -493,7 +497,7 @@ public class PrepareReleaseMojo { IOUtil.close( writer ); } - + try { ScmBean scm = getScm(); @@ -501,11 +505,11 @@ public class PrepareReleaseMojo scm.setWorkingDirectory( basedir ); List scmChanges = scm.getStatus(); - + for ( Iterator i = scmChanges.iterator(); i.hasNext(); ) { ScmFile f = (ScmFile) i.next(); - + if ( f.getPath().equals( "release-pom.xml" ) && f.getStatus() != ScmFileStatus.MODIFIED ) { getScm().add( RELEASE_POM ); @@ -522,21 +526,21 @@ public class PrepareReleaseMojo } } - private String resolveVersion( Artifact artifact, String artifactUsage ) + private String resolveVersion( Artifact artifact, String artifactUsage ) throws MojoExecutionException { if ( artifact.getFile() == null ) { try { - artifactMetadataSource.retrieve(artifact, localRepository, project.getPluginArtifactRepositories() ); + artifactMetadataSource.retrieve( artifact, localRepository, project.getPluginArtifactRepositories() ); } catch ( ArtifactMetadataRetrievalException e ) { throw new MojoExecutionException( "Cannot resolve " + artifactUsage + ": " + artifact.getId(), e ); } } - + return artifact.getVersion(); } diff --git a/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/VersionTransformer.java b/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/VersionTransformer.java index 66bad9fa2b..3de4644109 100644 --- a/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/VersionTransformer.java +++ b/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/transformer/VersionTransformer.java @@ -83,6 +83,8 @@ public class VersionTransformer Node type = node.selectSingleNode( "type" ); + Node classifier = node.selectSingleNode( "classifier" ); + String typeText = "jar"; if ( type != null ) @@ -91,7 +93,8 @@ public class VersionTransformer } Node version = node.selectSingleNode( "version" ); - String versionText = getDependency( groupId.getText(), artifactId.getText(), typeText ).getVersion(); + String versionText = getDependency( groupId.getText(), artifactId.getText(), typeText, + classifier.getText() ).getVersion(); if ( version != null ) { version.setText( versionText ); @@ -183,14 +186,16 @@ public class VersionTransformer } } - private Dependency getDependency( String groupId, String artifactId, String type ) + private Dependency getDependency( String groupId, String artifactId, String type, String classifier ) { + // TODO: equals() in Dependency would be better for ( Iterator i = getUpdatedModel().getDependencies().iterator(); i.hasNext(); ) { Dependency dependency = (Dependency) i.next(); if ( dependency.getGroupId().equals( groupId ) && dependency.getArtifactId().equals( artifactId ) && - dependency.getType().equals( type ) ) + dependency.getType().equals( type ) && dependency.getClassifier() != null + ? dependency.getClassifier().equals( classifier ) : classifier == null ) { return dependency; } diff --git a/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java b/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java index dd736ae228..7d9711868c 100644 --- a/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java +++ b/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java @@ -86,7 +86,7 @@ public class DefaultMavenProjectBuilder private PlexusContainer container; protected ArtifactResolver artifactResolver; - + protected ArtifactMetadataSource artifactMetadataSource; private ArtifactFactory artifactFactory; @@ -94,7 +94,7 @@ public class DefaultMavenProjectBuilder private ModelInheritanceAssembler modelInheritanceAssembler; private ModelValidator validator; - + // TODO: make it a component private MavenXpp3Reader modelReader; @@ -146,12 +146,13 @@ public class DefaultMavenProjectBuilder Artifact projectArtifact = project.getArtifact(); Map managedVersions = createManagedVersionMap( project.getDependencyManagement() ); - + ensureMetadataSourceIsInitialized(); try { - project.setDependencyArtifacts( MavenProject.createArtifacts( artifactFactory, project.getDependencies() ) ); + project.setDependencyArtifacts( + MavenProject.createArtifacts( artifactFactory, project.getDependencies() ) ); } catch ( InvalidVersionSpecificationException e ) { @@ -166,8 +167,8 @@ public class DefaultMavenProjectBuilder project.setArtifacts( result.getArtifacts() ); return project; } - - private void ensureMetadataSourceIsInitialized() + + private void ensureMetadataSourceIsInitialized() throws ProjectBuildingException { if ( artifactMetadataSource == null ) @@ -199,7 +200,7 @@ public class DefaultMavenProjectBuilder VersionRange versionRange = VersionRange.createFromVersionSpec( d.getVersion() ); Artifact artifact = artifactFactory.createDependencyArtifact( d.getGroupId(), d.getArtifactId(), versionRange, d.getType(), - d.getScope() ); + d.getClassifier(), d.getScope() ); map.put( d.getManagementKey(), artifact ); } catch ( InvalidVersionSpecificationException e ) @@ -231,7 +232,8 @@ public class DefaultMavenProjectBuilder modelCache.put( createCacheKey( model.getGroupId(), model.getArtifactId(), model.getVersion() ), model ); MavenProject project = build( projectDescriptor.getAbsolutePath(), model, localRepository, - Collections.EMPTY_LIST, externalProfiles, projectDescriptor.getAbsoluteFile().getParentFile() ); + Collections.EMPTY_LIST, externalProfiles, + projectDescriptor.getAbsoluteFile().getParentFile() ); // Only translate the base directory for files in the source tree pathTranslator.alignToBaseDirectory( project.getModel(), projectDescriptor ); @@ -345,10 +347,11 @@ public class DefaultMavenProjectBuilder } Model originalModel = ModelUtils.cloneModel( model ); - + List repositories = new ArrayList( aggregatedRemoteWagonRepositories ); - - MavenProject project = assembleLineage( model, lineage, repositories, localRepository, externalProfiles, projectDir ); + + MavenProject project = assembleLineage( model, lineage, repositories, localRepository, externalProfiles, + projectDir ); project.setOriginalModel( originalModel ); @@ -479,7 +482,9 @@ public class DefaultMavenProjectBuilder return project; } - /** @noinspection CollectionDeclaredAsConcreteClass*/ + /** + * @noinspection CollectionDeclaredAsConcreteClass + */ private MavenProject assembleLineage( Model model, LinkedList lineage, List aggregatedRemoteWagonRepositories, ArtifactRepository localRepository, List externalProfiles, File projectDir ) throws ProjectBuildingException @@ -520,20 +525,20 @@ public class DefaultMavenProjectBuilder { throw new ProjectBuildingException( "Missing version element from parent element" ); } - + model = getCachedModel( parentModel.getGroupId(), parentModel.getArtifactId(), parentModel.getVersion() ); - + // the only way this will have a value is if we find the parent on disk... File parentProjectDir = null; - + String parentRelativePath = parentModel.getRelativePath(); - + // if we can't find a cached model matching the parent spec, then let's try to look on disk using // - if ( model == null && projectDir != null && StringUtils.isNotEmpty(parentRelativePath) ) + if ( model == null && projectDir != null && StringUtils.isNotEmpty( parentRelativePath ) ) { File parentDescriptor = new File( projectDir, parentRelativePath ); - + try { parentDescriptor = parentDescriptor.getCanonicalFile(); @@ -541,34 +546,37 @@ public class DefaultMavenProjectBuilder catch ( IOException e ) { getLogger().debug( "Failed to canonicalize potential parent POM: \'" + parentDescriptor + "\'", e ); - + parentDescriptor = null; } - + if ( parentDescriptor != null && parentDescriptor.exists() ) { Model candidateParent = readModel( parentDescriptor ); - + // this works because parent-version is still required... - if ( parentModel.getGroupId().equals( candidateParent.getGroupId() ) - && parentModel.getArtifactId().equals( candidateParent.getArtifactId() ) - && ( parentModel.getVersion().equals( candidateParent.getVersion() ) - || ( candidateParent.getParent() != null - && parentModel.getVersion().equals(candidateParent.getParent().getVersion() ) ) ) ) + if ( parentModel.getGroupId().equals( candidateParent.getGroupId() ) && + parentModel.getArtifactId().equals( candidateParent.getArtifactId() ) && ( + parentModel.getVersion().equals( candidateParent.getVersion() ) || ( + candidateParent.getParent() != null && + parentModel.getVersion().equals( candidateParent.getParent().getVersion() ) ) ) ) { model = candidateParent; - + parentProjectDir = parentDescriptor.getParentFile(); - - getLogger().debug( "Using parent-POM from the project hierarchy at: \'" + parentModel.getRelativePath() + "\' for project: " + project.getId() ); + + getLogger().debug( "Using parent-POM from the project hierarchy at: \'" + + parentModel.getRelativePath() + "\' for project: " + project.getId() ); } else { - getLogger().debug("Invalid parent-POM referenced by relative path: \'" + parentModel.getRelativePath() + "\'. It did not match parent specification in " + project.getId() ); + getLogger().debug( "Invalid parent-POM referenced by relative path: \'" + + parentModel.getRelativePath() + "\'. It did not match parent specification in " + + project.getId() ); } } } - + Artifact parentArtifact = null; // only resolve the parent model from the repository system if we didn't find it on disk... @@ -590,7 +598,8 @@ public class DefaultMavenProjectBuilder model = findModelFromRepository( parentArtifact, aggregatedRemoteWagonRepositories, localRepository ); } - MavenProject parent = assembleLineage( model, lineage, aggregatedRemoteWagonRepositories, localRepository, externalProfiles, parentProjectDir ); + MavenProject parent = assembleLineage( model, lineage, aggregatedRemoteWagonRepositories, localRepository, + externalProfiles, parentProjectDir ); project.setParent( parent ); @@ -704,10 +713,10 @@ public class DefaultMavenProjectBuilder } protected Set createReportArtifacts( List reports ) - throws ProjectBuildingException + throws ProjectBuildingException { Set pluginArtifacts = new HashSet(); - + if ( reports != null ) { for ( Iterator i = reports.iterator(); i.hasNext(); ) diff --git a/maven-project/src/main/java/org/apache/maven/project/MavenProject.java b/maven-project/src/main/java/org/apache/maven/project/MavenProject.java index 11421a87f7..a123f94f94 100644 --- a/maven-project/src/main/java/org/apache/maven/project/MavenProject.java +++ b/maven-project/src/main/java/org/apache/maven/project/MavenProject.java @@ -19,9 +19,9 @@ package org.apache.maven.project; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.ArtifactUtils; import org.apache.maven.artifact.DependencyResolutionRequiredException; -import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.model.Build; import org.apache.maven.model.CiManagement; import org.apache.maven.model.Contributor; @@ -387,6 +387,7 @@ public class MavenProject dependency.setVersion( a.getVersion() ); dependency.setScope( a.getScope() ); dependency.setType( a.getType() ); + dependency.setClassifier( a.getClassifier() ); list.add( dependency ); } @@ -471,6 +472,7 @@ public class MavenProject dependency.setVersion( a.getVersion() ); dependency.setScope( a.getScope() ); dependency.setType( a.getType() ); + dependency.setClassifier( a.getClassifier() ); list.add( dependency ); } @@ -552,6 +554,7 @@ public class MavenProject dependency.setVersion( a.getVersion() ); dependency.setScope( a.getScope() ); dependency.setType( a.getType() ); + dependency.setClassifier( a.getClassifier() ); list.add( dependency ); } diff --git a/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java b/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java index 96a4a5401c..ff50def23a 100644 --- a/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java +++ b/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java @@ -49,9 +49,9 @@ public class MavenMetadataSource extends AbstractLogEnabled implements ArtifactMetadataSource { - + public static final String ROLE_HINT = "maven"; - + private MavenProjectBuilder mavenProjectBuilder; private ArtifactFactory artifactFactory; @@ -150,8 +150,8 @@ public class MavenMetadataSource VersionRange versionRange = VersionRange.createFromVersionSpec( d.getVersion() ); Artifact artifact = artifactFactory.createDependencyArtifact( d.getGroupId(), d.getArtifactId(), - versionRange, d.getType(), d.getScope(), - inheritedScope ); + versionRange, d.getType(), d.getClassifier(), + d.getScope(), inheritedScope ); if ( artifact != null && ( dependencyFilter == null || dependencyFilter.include( artifact ) ) ) { diff --git a/maven-project/src/test/java/org/apache/maven/project/TestArtifactResolver.java b/maven-project/src/test/java/org/apache/maven/project/TestArtifactResolver.java index 37c043538a..47bedf7426 100644 --- a/maven-project/src/test/java/org/apache/maven/project/TestArtifactResolver.java +++ b/maven-project/src/test/java/org/apache/maven/project/TestArtifactResolver.java @@ -53,7 +53,7 @@ public class TestArtifactResolver implements Contextualizable { public static final String ROLE = TestArtifactResolver.class.getName(); - + private ArtifactRepositoryFactory repositoryFactory; private PlexusContainer container; @@ -146,7 +146,8 @@ public class TestArtifactResolver VersionRange versionRange = VersionRange.createFromVersionSpec( d.getVersion() ); Artifact artifact = artifactFactory.createDependencyArtifact( d.getGroupId(), d.getArtifactId(), - versionRange, d.getType(), d.getScope(), + versionRange, d.getType(), + d.getClassifier(), d.getScope(), inheritedScope ); if ( artifact != null ) { @@ -157,7 +158,7 @@ public class TestArtifactResolver return projectArtifacts; } } - + public Source source() { return new Source( artifactFactory, repositoryFactory, container );