@@ -10,7 +10,6 @@ import scala.util.Success
1010import scala .util .Try
1111import bloop .config .Config
1212import bloop .config .Tag
13- import org .apache .maven .RepositoryUtils
1413import org .apache .maven .artifact .Artifact
1514import org .apache .maven .artifact .ArtifactUtils
1615import org .apache .maven .execution .MavenSession
@@ -22,6 +21,7 @@ import org.apache.maven.plugin.logging.Log
2221import org .apache .maven .project .MavenProject
2322import org .codehaus .plexus .util .xml .Xpp3Dom
2423import org .eclipse .aether .artifact .DefaultArtifact
24+ import org .eclipse .aether .artifact .DefaultArtifactType
2525import org .eclipse .aether .resolution .ArtifactRequest
2626import scala_maven .AppLauncher
2727
@@ -85,7 +85,26 @@ object MojoImplementation {
8585 val suffix = if (classifier.nonEmpty) s " : $classifier" else " "
8686 log.info(" Resolving artifact: " + artifact + suffix)
8787 val request = new ArtifactRequest ()
88- request.setArtifact(RepositoryUtils .toArtifact(artifact))
88+ val handler = artifact.getArtifactHandler()
89+ val artifactType = new DefaultArtifactType (
90+ artifact.getType(),
91+ handler.getExtension(),
92+ handler.getClassifier(),
93+ handler.getLanguage(),
94+ handler.isAddedToClasspath(),
95+ handler.isIncludesDependencies()
96+ )
97+ request.setArtifact(
98+ new DefaultArtifact (
99+ artifact.getGroupId(),
100+ artifact.getArtifactId(),
101+ classifier,
102+ handler.getExtension(),
103+ artifact.getVersion(),
104+ null ,
105+ artifactType
106+ )
107+ )
89108 request.setRepositories(mojo.getRemoteRepositories())
90109 val result = mojo.getRepoSystem().resolveArtifact(session.getRepositorySession(), request)
91110 log.info(" SUCCESS " + artifact)
0 commit comments