slachiewicz opened a new pull request, #2121:
URL: https://github.com/apache/maven-resolver/pull/2121

   Ports master's real-path check for locally cached artifacts to the 1.9.x 
line, which does not have it.
   
   On case-insensitive or normalization-preserving filesystems (the macOS and 
Windows defaults) a file cached for one set of coordinates also answers lookups 
for coordinates that differ only in case or Unicode normalization. The tracking 
data is compared exactly, so the aliased file is treated as 
present-but-untracked and accepted with no download and no checksum 
verification. `checkFind` now compares the requested relative path against the 
symlink-resolved real path and treats a mismatch as not present.
   
   Two deliberate differences from master, both forced by the line:
   
   - **The base path is resolved lazily.** Master resolves it in the 
constructor, which had to gain `throws IOException` and a 
`Files.createDirectories` call because a fresh local repository does not exist 
yet. On 1.9.x that would push the checked exception through 
`EnhancedLocalRepositoryManagerFactory.newInstance`, so the value is resolved 
on first use instead. The `&&` short-circuit in `checkFind` means it is only 
reached once a file is known to exist, so the fresh-repository case never gets 
there.
   - **The property is `aether.enhancedLocalRepository.verifyRealPath`**, 
matching this line's existing 
`aether.enhancedLocalRepository.trackingFilename`. Master uses 
`aether.lrm.enhanced.verifyRealPath` via its newer `PREFIX_LRM` namespace, 
which 1.9.x does not have.
   
   Master is on `Path` throughout (`checkFind(Path…)`, `Files.isRegularFile`, 
`result.setPath`); 1.9.x is on `File`, so this is a port rather than a 
cherry-pick.
   
   On the tests: `testFindCaseAliasedArtifactIsNotAvailable` only exercises the 
new branch on a case-insensitive filesystem — elsewhere the aliased file simply 
does not exist and the assertion holds for the ordinary reason. I confirmed the 
guard is what makes it pass, by re-running it with `verifyRealPath=false` and 
observing the alias resolve (`available = true`) on a case-insensitive volume. 
The other two tests are portable: verification enabled must not disturb an 
ordinary lookup, and the opt-out must not either.
   
   Verified: `mvn clean install` -> BUILD SUCCESS, 1044 tests, 0 failures, 0 
errors.
   
   *This change was created with AI assistance.*
   


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