efegokdemir commented on code in PR #1393:
URL: 
https://github.com/apache/maven-javadoc-plugin/pull/1393#discussion_r4717699945


##########
src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java:
##########
@@ -2603,8 +2603,11 @@ public Artifact resolveDependency(Dependency dependency) 
throws MavenReportExcep
         try {
             ArtifactResult resolutionResult = 
repoSystem.resolveArtifact(repoSession, req);
             return RepositoryUtils.toArtifact(resolutionResult.getArtifact());
-        } catch (ArtifactResolutionException e) {
-            throw new MavenReportException("artifact resolver problem - " + 
e.getMessage(), e);
+        } catch (ArtifactResolutionException | IllegalArgumentException e) {

Review Comment:
   The exception is raised in the `RepositorySystem.resolveArtifact` call. With 
an unresolved `${missing.version}`, Maven leaves the dependency version null; 
`DefaultArtifactResolver` asks the reactor workspace reader to locate it, and 
`ArtifactUtils.key()` throws `IllegalArgumentException` because the version is 
null. It is not wrapped as an `ArtifactResolutionException`, so the existing 
catch did not include the dependency coordinates. I verified this with the 
targeted Invoker case; the stack trace points to `ArtifactUtils.notBlank` → 
`ArtifactUtils.key` → `ReactorReader.findArtifact` → 
`DefaultArtifactResolver.resolve`. The updated test still covers the wrapped 
cause.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to