Skip to content

Feat: Maven 3.x with Resolver 2.x - #11778

Merged
cstamas merged 9 commits into
apache:maven-3.10.xfrom
cstamas:maven-3.9.x-resolver-2.x
Apr 8, 2026
Merged

cstamas merged 9 commits into
apache:maven-3.10.xfrom
cstamas:maven-3.9.x-resolver-2.x

Conversation

@cstamas

@cstamas cstamas commented Mar 10, 2026 •

Copy link
Copy Markdown
Member

This is Maven 3.x line using Resolver 2.x.

Notable:

  • the Resolver 1.x "http" HTTP transport got renamed to "apache" transport (IT MavenITmng7470ResolverTransportTest needs change for this)
  • IT MavenITmng4368TimestampAwareArtifactInstallerTest is fluke: Resolver 2.x unlike Resolver 1.x always installs if asked to install. Resolver 1.x had some rudimentary logic (file timestamp, file size) to perform "change detection" that was removed from Resolver 2.x. If user wants "conditional install" then the install API call needs to be wrapped into condition.

Temporary changes applied to ITs on maven-3.9.x-resolver-2.x branch:
apache/maven-integration-testing#420

@cstamas cstamas self-assigned this Mar 10, 2026
@cstamas cstamas added the enhancement New feature or request label Mar 10, 2026
@cstamas cstamas added this to the 3.10.0 milestone Mar 10, 2026
@cstamas cstamas changed the title Maven 3.9.x resolver 2.x Maven 3.x with Resolver 2.x Mar 10, 2026
@cstamas

This comment was marked as outdated.

@cstamas cstamas changed the title Maven 3.x with Resolver 2.x Feat: Maven 3.x with Resolver 2.x Mar 10, 2026
@cstamas

This comment was marked as outdated.

@cstamas
cstamas marked this pull request as ready for review March 10, 2026 13:41
@cstamas
cstamas changed the base branch from maven-3.9.x to maven-3.10.x March 25, 2026 15:50
Comment thread pom.xml Outdated
Comment on lines +517 to +525
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>maven-2404</id>
<url>https://repository.apache.org/content/repositories/maven-2404/</url>
</repository>
</repositories>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Dropped

@cstamas
cstamas merged commit e04f0bd into apache:maven-3.10.x Apr 8, 2026
18 checks passed
@cstamas
cstamas deleted the maven-3.9.x-resolver-2.x branch April 8, 2026 15:25
@jglick

jglick commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Does this expose 3.10 to #11856? Could not grasp what this is about from a quick read.

@cstamas

cstamas commented Jul 20, 2026 •

Copy link
Copy Markdown
Member Author

This PR updates Maven dependency on Resolver from 1.9.x to 2.0.x.

Yes, as Resolver 2.x automatically resolves prefixes (configurable, see aether.remoteRepositoryFilter.prefixes.resolvePrefixFiles here https://maven.apache.org/resolver/configuration.html).

But, 3.10.0 GA will use Resolver 2.0.21 (currently on vote) that has this:
apache/maven-resolver#1976

ajreynol pushed a commit to ajreynol/cvc5 that referenced this pull request Oct 9, 2026
The publication of cvc5 1.4.2 to Maven Central failed
([job](https://github.com/cvc5/cvc5/actions/runs/37712539316/job/113125735442)):

```
Deployment 30d08c38-b120-4a77-b2a3-65b54aa68789 failed
 - Bundle has content that does NOT have a .pom file: io/github/cvc5/cvc5
```

**Cause.** Nothing Maven-related changed between 1.4.1 and 1.4.2, but
the `ubuntu-24.04` runner image did: Maven went from 3.9.16 (image
20260920.314, used for 1.4.1) to 3.10.0 (image 20261004.327, used for
1.4.2). `central-publishing-maven-plugin` stages the artifacts by
installing them into `target/central-staging` (repository id
`central-staging`) through Maven's maven-compat installer, then deletes
`maven-metadata-central-staging.xml` and zips the directory. In Maven
3.10.0, which uses Maven Resolver 2.x,
`LegacyLocalRepositoryManager.overlay()` no longer wraps that directory
in a legacy local repository manager but sets up a regular Resolver 2
one (apache/maven#11778), so the installation writes local-repository
bookkeeping files instead: `maven-metadata-local.xml` and
`_remote.repositories`. The plugin does not remove them, and Central
rejects the bundle because `maven-metadata-local.xml` sits in
`io/github/cvc5/cvc5/`, next to no `.pom`. The release logs show this:
1.4.0 and 1.4.1 have `Pre Bundling - deleted
.../maven-metadata-central-staging.xml`, 1.4.2 does not.

The Maven side is reported in apache/maven#13388 (not part of the 3.10.0
release notes' breaking changes). Many other projects hit the same error
after the runner image update, and several pinned Maven 3.9.16 as well.

This is reproducible with a minimal project and both plugin 0.9.0 (ours)
and 0.11.0 (the latest; its release notes do not mention it), so
upgrading the plugin does not help:

| Maven | Bundle contents |
|---|---|
| 3.9.16 | `demo-1.0.0.jar`, `demo-1.0.0.pom` |
| 3.10.0 | `demo-1.0.0.jar`, `demo-1.0.0.pom`,
`maven-metadata-local.xml`, `_remote.repositories` |

**Fix.** Install Maven 3.9.16 from Maven Central (verifying its SHA-512)
in the "Publish to Maven central" job, instead of using the Maven
version of the runner image. The image only ships Maven 3.10.0 (no other
version, also not in its tool cache), so a download is needed; it is 9
MB. This is the only job that runs Maven. 1.4.2 was published this way
with a one-off workflow, and Central accepted it.

The pin can be removed once apache/maven#13388 is fixed or the plugin
supports Maven 3.10 (the comment in the workflow links the issue).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants