elharo opened a new issue, #1648:
URL: https://github.com/apache/maven-dependency-plugin/issues/1648

   `BuildClasspathMojo.execute()` at line 199-205:
   
   ```java
   Set<Artifact> artifacts = getResolvedDependencies(true);
   
   if (artifacts == null || artifacts.isEmpty()) {
       getLog().info("No dependencies found.");
   }
   
   List<Artifact> artList = new ArrayList<>(artifacts);  // NPE if null
   ```
   
   When `getResolvedDependencies()` returns `null`, the code logs "No 
dependencies found." but then falls through to `new ArrayList<>(null)`, which 
throws NullPointerException. There is no `return` statement after the 
null/empty check.
   
   If `artifacts` is empty (not null), execution continues normally and 
produces an empty classpath string, which is harmless but inconsistent.
   


-- 
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