bug: LRM may be created for non-existent directories - #2115
Closed
cstamas wants to merge 1 commit into
Closed
Conversation
And it caused this:
```
Suppressed: org.eclipse.aether.repository.NoLocalRepositoryManagerException: No manager available for local repository (/home/cstamas/Worx/maveniverse/checksum/it/plugin3-its/target/local-repo) of type default
at org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory.newInstance (EnhancedLocalRepositoryManagerFactory.java:163)
at org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider.newLocalRepositoryManager (DefaultLocalRepositoryProvider.java:73)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.createLocalRepositoryManager (DefaultRepositorySystem.java:570)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.newLocalRepositoryManager (DefaultRepositorySystem.java:529)
at org.apache.maven.plugins.invoker.InstallMojo.createSystemSessionForLocalRepo (InstallMojo.java:418)
at org.apache.maven.plugins.invoker.InstallMojo.installArtifacts (InstallMojo.java:363)
at org.apache.maven.plugins.invoker.InstallMojo.execute (InstallMojo.java:177)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:127)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:336)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:324)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:220)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:181)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:79)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:169)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:166)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:106)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:74)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:121)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:267)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:179)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:1017)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:299)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:219)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:255)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:362)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)
Caused by: java.nio.file.NoSuchFileException: /home/cstamas/Worx/maveniverse/checksum/it/plugin3-its/target/local-repo
at sun.nio.fs.UnixException.translateToIOException (UnixException.java:92)
at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:106)
at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:111)
at sun.nio.fs.UnixPath.toRealPath (UnixPath.java:834)
at org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManager.<init> (EnhancedLocalRepositoryManager.java:152)
at org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory.newInstance (EnhancedLocalRepositoryManagerFactory.java:161)
at org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider.newLocalRepositoryManager (DefaultLocalRepositoryProvider.java:73)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.createLocalRepositoryManager (DefaultRepositorySystem.java:570)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.newLocalRepositoryManager (DefaultRepositorySystem.java:529)
at org.apache.maven.plugins.invoker.InstallMojo.createSystemSessionForLocalRepo (InstallMojo.java:418)
at org.apache.maven.plugins.invoker.InstallMojo.installArtifacts (InstallMojo.java:363)
```
gnodet
reviewed
Sep 2, 2026
gnodet
left a comment
Contributor
There was a problem hiding this comment.
This draft PR fixes the same regression as PR #2111 — both add Files.createDirectories() before toRealPath() in EnhancedLocalRepositoryManager. The production code change is identical.
PR #2111 is the more complete version:
- Includes a clarifying code comment explaining why the directory must be created
- Adds two regression tests: one verifying the factory accepts a non-existent basedir, and one verifying
DefaultLocalRepositoryProviderdoesn't silently degrade toSimpleLocalRepositoryManager - Already reviewed and approved
Recommend closing this draft in favor of merging #2111.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
Member
Author
|
I missed #2111 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
And it caused this:
Following this checklist to help us incorporate your
contribution quickly and easily:
Note that commits might be squashed by a maintainer on merge.
This may not always be possible but is a best-practice.
mvn verifyto make sure basic checks pass.A more thorough check will be performed on your pull request automatically.
mvn -Prun-its verify).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.