Skip to content

bug: LRM may be created for non-existent directories - #2115

Closed
cstamas wants to merge 1 commit into
apache:masterfrom
cstamas:lrm-bug
Closed

bug: LRM may be created for non-existent directories#2115
cstamas wants to merge 1 commit into
apache:masterfrom
cstamas:lrm-bug

Conversation

@cstamas

@cstamas cstamas commented Sep 2, 2026

Copy link
Copy Markdown
Member

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)

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (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.

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)
```
@cstamas cstamas added this to the 2.0.23 milestone Sep 2, 2026
@cstamas
cstamas requested a review from gnodet September 2, 2026 07:58
@cstamas cstamas self-assigned this Sep 2, 2026
@cstamas cstamas added the bug Something isn't working label Sep 2, 2026

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DefaultLocalRepositoryProvider doesn't silently degrade to SimpleLocalRepositoryManager
  • 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

@cstamas

cstamas commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

I missed #2111

@cstamas cstamas closed this Sep 2, 2026
@cstamas
cstamas deleted the lrm-bug branch September 2, 2026 08:13
@github-actions github-actions Bot removed this from the 2.0.23 milestone Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants