You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "slawekjaranowski (via GitHub)" <gi...@apache.org> on 2023/04/15 17:40:05 UTC

[GitHub] [maven-plugin-tools] slawekjaranowski commented on a diff in pull request #201: [MPLUGIN-457] Use Resolver API, get rid of localRepository

slawekjaranowski commented on code in PR #201:
URL: https://github.com/apache/maven-plugin-tools/pull/201#discussion_r1167593104


##########
maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java:
##########
@@ -570,19 +572,18 @@ protected void extendJavaProjectBuilderWithSourcesJar(
             JavaProjectBuilder builder, Artifact artifact, PluginToolsRequest request, String classifier)
             throws ExtractionException {
         try {
-            Artifact sourcesArtifact = repositorySystem.createArtifactWithClassifier(
+            org.eclipse.aether.artifact.Artifact sourcesArtifact = new DefaultArtifact(
                     artifact.getGroupId(),
                     artifact.getArtifactId(),
-                    artifact.getVersion(),
+                    classifier,
                     artifact.getType(),
-                    classifier);
-
-            ArtifactResolutionRequest req = new ArtifactResolutionRequest();
-            req.setArtifact(sourcesArtifact);
-            req.setLocalRepository(request.getLocal());
-            req.setRemoteRepositories(request.getRemoteRepos());
-            ArtifactResolutionResult res = repositorySystem.resolve(req);
-            if (res.hasMissingArtifacts() || res.hasExceptions()) {
+                    artifact.getVersion());
+
+            ArtifactRequest resolveRequest = new ArtifactRequest(sourcesArtifact, request.getRemoteRepos(), null);

Review Comment:
   It is - The context in which this request is made, may be null.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org