elharo opened a new pull request, #156:
URL: https://github.com/apache/maven-shared-jar/pull/156

   Closes #134
   
   ### Summary
   
   Issue #134 reports that `FilenameExposer` truncates multi-digit version 
numbers (e.g. `my-lib-12.3.4.jar` would yield version `2.3.4`).
   
   Investigation showed the described behavior does not reproduce. 
`FilenameExposer` uses `filename.substring(mat.end() - 1)`, where `mat.end() - 
1` is the index of the first digit matched by the `-\\d` pattern. `substring()` 
therefore includes the full multi-digit version, so `my-lib-12.3.4.jar` 
correctly yields `12.3.4`, `my-lib-10.jar` yields `10`, etc. No source change 
is required.
   
   ### Test
   
   Adds `FilenameExposerTest`, which builds JARs in memory with 
version-specific filenames and asserts `FilenameExposer` extracts the full 
version:
   - `my-lib-12.3.4.jar` → `12.3.4`
   - `my-lib-10.jar` → `10`
   - `my-lib-21.5.7.jar` → `21.5.7`
   - `my-lib-9.0.jar` → `9.0`
   - `my-lib.jar` → no version
   
   These tests document the expected behavior and guard against regressions.


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