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

   `CompareMojo.getRepositoryFilename(Artifact)` (lines 328-331):
   
   ```java
   String path = 
session.getRepositorySession().getLocalRepositoryManager().getPathForLocalArtifact(a);
   return path.substring(path.lastIndexOf('/'));
   ```
   
   `path.substring(path.lastIndexOf('/'))` throws 
`StringIndexOutOfBoundsException` if the local-repo layout returns a filename 
without a `/` separator (root-based `pom` layout in some configurations). Also 
a negative index propagates as a confusing runtime exception rather than a 
clean `MojoExecutionException`.
   
   Suggested fix: guard `lastIndexOf('/')` and use `Path`-based extraction.


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