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

   Since #2104 `EnhancedLocalRepositoryManager` resolves the real path of its 
base directory in the constructor, and `Path.toRealPath()` requires the path to 
exist.
   
   A local repository that has not been created yet (first build on a machine, 
or a new `-Dmaven.repo.local`) therefore made the enhanced factory throw 
`NoLocalRepositoryManagerException`. `DefaultLocalRepositoryProvider` treats 
that as "try the next factory" and quietly selected 
`SimpleLocalRepositoryManager`, so the whole first session ran without 
`_remote.repositories` tracking. Before #2104 the real path was computed 
lazily, only for files that already existed, so the directory was always 
present.
   
   The fix creates the directory before resolving it. Maven creates it on first 
write anyway and the enhanced manager needs it for its tracking files, so 
nothing observable changes for a usable local repository; an unwritable 
location still fails the same way it did before.
   
   Two tests cover the factory directly and the provider's fallback selection 
with a not-yet-existing base directory; both fail on master with the 
`NoSuchFileException` cause.
   
   *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