akashchamp opened a new pull request, #252:
URL: https://github.com/apache/maven-artifact-plugin/pull/252

   Closes #248
   
   ## What and why
   
   `CompareMojo` assumes a local repository manager always returns a path 
containing `/` and slices the string at the final separator. A repository 
manager may return a bare filename instead, causing 
`StringIndexOutOfBoundsException` before comparison starts. Use `Path` 
file-name extraction so both bare filenames and nested repository paths resolve 
to the artifact filename.
   
   ## Validation
   
   - Added a regression test for both a separator-free filename and a nested 
repository path.
   - Reproduced the pre-fix exception, then manually verified that both path 
forms return `artifact-1.0.pom` and produce the expected reference-file join.
   - `mvn verify` passed.
   - `mvn -Prun-its verify` passed all 16 Invoker scenarios.
   
   ## Checklist
   
   - [x] This pull request addresses one issue without unrelated changes.
   - [x] The commit has a meaningful subject and body.
   - [x] Tests cover the behavioral change.
   - [x] `mvn verify` passed.
   - [x] `mvn -Prun-its verify` passed.
   - [x] I hereby declare this contribution to be licenced under the Apache 
License Version 2.0, January 2004.
   


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