elharo opened a new pull request, #12631:
URL: https://github.com/apache/maven/pull/12631
Fixes #12604
## Problem
The condition `!file.isAbsolute() &&
file.toString().startsWith(File.separator)` is **always false** on all
platforms:
- On Unix: any path starting with `/` is absolute, so `!file.isAbsolute()`
is false
- On Windows: any path starting with `\` is absolute (drive-relative), so
`!file.isAbsolute()` is false
This made the entire local repository path resolution block dead code.
## Fix
Replace the impossible condition with `!file.isAbsolute()` (skipping paths
containing `${` placeholders that need later interpolation). This correctly
resolves relative paths like `relative/repo` to absolute.
## Testing
Added `testRelativeLocalRepositoryIsResolvedToAbsolute` which loads a
settings file with `<localRepository>relative/repo</localRepository>` and
verifies the output path is absolute.
Existing test `testSettingsWithServersAndAliases` continues to pass because
paths containing `${user.home}` placeholders are left untouched.
--
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]