Skip to content

[3.10.0] LegacyLocalRepositoryManager.overlay() now writes Resolver local-repository files into the target repository (breaks central-publishing-maven-plugin) #13388

Closed

Description

@NassimBtk

Affected version

3.10.0

Bug description

Since Maven 3.10.0, LegacyLocalRepositoryManager.overlay(ArtifactRepository, RepositorySystemSession, RepositorySystem) changed:

  • 3.10.0: for a repository that uses DefaultRepositoryLayout, it returns a session whose local repository manager is a regular Resolver 2 manager, set up by DefaultRepositorySystemSessionFactory.setUpLocalRepositoryManager. This came with Feat: Maven 3.x with Resolver 2.x #11778.
  • 3.9.x: it always wrapped the repository in a LegacyLocalRepositoryManager.

As a result, a plugin that calls the maven-compat ArtifactInstaller.install(file, artifact, repository) to install into a directory that is not the local repository now gets local-repository bookkeeping files in that directory:

File 3.9.x 3.10.0
Group/artifact-level metadata maven-metadata-<repositoryId>.xml maven-metadata-local.xml
Origin tracking none <version>/_remote.repositories
Locks none .locks/*.lock (file-lock named locks, the Resolver 2 default)

Impact. org.sonatype.central:central-publishing-maven-plugin 0.11.0, the current release used to publish to Maven Central, stages release artifacts this way into target/central-staging (repository id central-staging). It then:

  1. deletes only maven-metadata-central-staging.xml;
  2. zips the staging directory;
  3. uploads the bundle.

Maven Central then rejects the deployment:

Deployment ... failed
common:
 - Bundle has content that does NOT have a .pom file: org/metricshub/jflat

This is also reported at mavenplugins/central-publishing-maven-plugin#78, where a multi-module project hits the same error. The plugin sources are not public, so I am reporting the Maven side here, and I am reporting the plugin side to Sonatype support.

Reproduction

  1. Use Maven 3.10.0 with any jar project that has a release version and central-publishing-maven-plugin 0.11.0 as an extension (<extensions>true</extensions>).
  2. Run mvn deploy -DcentralBaseUrl=http://127.0.0.1:9. The bundle is built, and the upload then fails locally.
  3. List target/central-publishing/central-bundle.zip. It contains:
    • .locks/artifact~<g>~<a>~...lock
    • <g>/<a>/<v>/_remote.repositories
    • <g>/<a>/maven-metadata-local.xml

With Maven 3.9.12, the same bundle contains only the artifacts and their checksums.

Workaround (release build only)

-Daether.priority.VersionsMetadataGeneratorFactory=NaN
-Daether.priority.EnhancedLocalRepositoryManagerFactory=NaN
-Daether.syncContext.named.factory=rwlock-local

Expected. Either:

  • keep the 3.9 behaviour of overlay() for a repository that is not the session's local repository: metadata named after the repository id, and no tracking or lock files written into the target directory; or
  • list this as a breaking change for maven-compat callers in the 3.10.0 release notes, so that plugin authors can adapt.

I can test a fix or a snapshot.

Activity

  1. cstamas commented on Oct 9, 2026

    @cstamas
    Member

    The mentioned plugin relies on deprecated Maven 2 features (the maven-compat, that is a module in Maven 3 providing Maven 2 backward compatibility). This is the reason why the mentioned plugin does not work in Maven 4 (major versions provides V-1 but not V-2 compatibility, so Maven 4 will not support Maven 2 stuff).

    The plugin should be fixed.

    Recommended replacement is https://maveniverse.eu/docs/njord/

  2. puredanger commented on Oct 11, 2026

    @puredanger

    FYI, last week the image used by Github CI action runners started using Maven CLI 3.10.0 (previous week was 3.9.16). That change triggered this condition for us and caused our builds to fail this week. It took a fair amount of investigation to find this issue. I suspect this change is likely to cause people to see this with greater frequency now.

  3. added a commit that references this issue on Oct 14, 2026
  4. gnodet commented on Oct 14, 2026

    @gnodet
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions