Fix: tidy up f013 - #2104
Fix: tidy up f013#2104
Conversation
The cnid_hurl is "central normalized" nid_hurl, and for MC it will keep returning "central" ID as before, making it compatible across all Maven versions.
gnodet
left a comment
There was a problem hiding this comment.
Looks good — clean improvement over the lazy volatile init. Two minor observations, neither blocking:
-
Stale Javadoc on
realBasePath: the comment still says "Lazily computed" but the field is nowfinaland eagerly initialized. Worth a quick update (e.g. "Resolved at construction time"). -
Unrelated
RemoteRepository.javachange: the@seefully-qualified fix is harmless but unrelated to therealBasePathimprovement — could be a separate commit or dropped to keep the diff focused.
Otherwise: final field, fail-fast at construction, IOException surfacing cleanly through the package-private constructor to the factory — strictly better than the previous pattern. 👍
|
@cstamas Please assign appropriate label to PR according to the type of change. |
…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.*
Flip system key instead.