elharo opened a new pull request, #287:
URL: https://github.com/apache/maven-remote-resources-plugin/pull/287

   Fixes https://github.com/apache/maven-remote-resources-plugin/issues/274
   
   ### Problem
   
   `ModelInheritanceAssembler.appendPath`/`resolvePath` (used for inherited SCM
   connection/url values in supplemental models) had edge-case inaccuracies:
   - trailing slashes were dropped, so `http://host/repo/` normalized to
     `http://host/repo`
   - excess `..` segments were silently swallowed (an acknowledged FIXME, no
     warning)
   - empty segments (`//`) were removed and `.` segments were kept, 
inconsistently
   
   ### Fix
   
   Rewrote `resolvePath` using the JDK `java.nio.file.Path.normalize()` (no 
plexus
   dependency for the new code):
   - trailing separators are now preserved
   - redundant separators, `.` and resolvable `..` segments are collapsed
   - excess `..` segments are detected and a warning is emitted via the Maven
     logger instead of being silently dropped (a `Log` is now injected into the
     assembler from the mojo)
   
   ### Test
   
   New unit test class `ModelInheritanceAssemblerTest` (5 tests):
   - trailing slash is preserved (fails before the fix)
   - `.` segments are collapsed (fails before the fix)
   - a warning is emitted for excess `..` segments (fails before the fix)
   - child appending and resolvable `..` normalization still work (regression)
   
   All existing tests pass: `mvn verify -Prun-its` (15 unit + 9 failsafe ITs,
   incl. `ITSupplementalArtifact` which exercises supplemental-model merging),
   plus spotless/checkstyle/RAT.


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