Skip to content

Commit 8a606df

Browse files
committed
Remove RepositoryUtils
1 parent 3a1d935 commit 8a606df

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

integrations/maven-bloop/src/main/scala/bloop/integrations/maven/MojoImplementation.scala

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import scala.util.Success
1010
import scala.util.Try
1111
import bloop.config.Config
1212
import bloop.config.Tag
13-
import org.apache.maven.RepositoryUtils
1413
import org.apache.maven.artifact.Artifact
1514
import org.apache.maven.artifact.ArtifactUtils
1615
import org.apache.maven.execution.MavenSession
@@ -22,6 +21,7 @@ import org.apache.maven.plugin.logging.Log
2221
import org.apache.maven.project.MavenProject
2322
import org.codehaus.plexus.util.xml.Xpp3Dom
2423
import org.eclipse.aether.artifact.DefaultArtifact
24+
import org.eclipse.aether.artifact.DefaultArtifactType
2525
import org.eclipse.aether.resolution.ArtifactRequest
2626
import 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

Comments
 (0)