Skip to content

Remove maven-compat, which needed three things rather than one - #158

Open
slachiewicz wants to merge 1 commit into
masterfrom
drop-maven-compat
Open

Remove maven-compat, which needed three things rather than one#158
slachiewicz wants to merge 1 commit into
masterfrom
drop-maven-compat

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Aug 8, 2026

Copy link
Copy Markdown
Member

Nothing here imports maven-compat, but three things reached it indirectly.

maven-core moved DefaultProjectBuildingHelper's legacy org.apache.maven.repository.RepositorySystem field to MavenRepositorySystem in 3.9.12 exactly (3afbdb8f76), so that is where mavenVersion lands, with the resolverVersion 1.9.25 that 3.9.12 itself ships. The test's local repository moves from ArtifactRepositoryFactory to the static MavenRepositorySystem.createArtifactRepository — same five parameters.

The javadoc-plugin pin is the non-obvious one. 3.4.0 needs RepositoryMetadataManager, whose only implementation is in maven-compat, so the removal was blocked by a component this project never mentions, reached through a plugin the test happens to load. Raising the baseline does not help there — that one was not fixed in 3.9.12. 3.12.0 does not use it.

<prerequisites> reads ${mavenVersion}, so the minimum Maven for consumers goes 3.6.3 → 3.9.12. apache/maven#12709 is open to settle that across the plugins and shared components; if the answer is "not yet", close this rather than leave it looking like an oversight.

Verified: mvn verify → 4 tests, 0 failures. verify rather than test because on a sibling project a maven-compat removal passed every test while breaking the build — only the dependency analysis catches a compile-classpath arrival.

This change was created with AI assistance.

Nothing here imports maven-compat, but removing it took more than
deleting the line.

First, the baseline. maven-core 3.6.3 ships DefaultProjectBuildingHelper
with a field of the legacy org.apache.maven.repository.RepositorySystem,
implemented only in maven-compat, so Mojo lookups fail without it.
maven-core 3.9.12 moved that field to MavenRepositorySystem in
maven-core -- commit 3afbdb8f76, first released in 3.9.12. So
mavenVersion moves there, and resolverVersion to the 1.9.25 that ships
with it.

Second, the test built its local repository through
ArtifactRepositoryFactory, which lives only in maven-compat.
MavenRepositorySystem.createArtifactRepository is a static method with
the same five parameters, so the call is unchanged apart from the
receiver.

Third, and least obvious: the test loads maven-javadoc-plugin to
exercise the executor, and pinned 3.4.0. That version needs
RepositoryMetadataManager, whose only implementation --
DefaultRepositoryMetadataManager -- is also in maven-compat, so the
removal failed on a component this project never mentions. Current
javadoc-plugin does not use it, so the pin moves to 3.12.0.

Tests: 4, 0 failures, same as master under mvn verify.
@slachiewicz slachiewicz added dependencies Pull requests that update a dependency file breaking Pull requests that break existing features labels Aug 8, 2026
@slachiewicz
slachiewicz requested a lite review from Copilot August 8, 2026 17:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the test-scoped maven-compat dependency by updating the project’s Maven/Resolver baselines and adjusting tests to use APIs available without maven-compat, including updating the pinned maven-javadoc-plugin used in tests.

Changes:

  • Bump mavenVersion to 3.9.12 and align resolverVersion to 1.9.25, then remove org.apache.maven:maven-compat from test dependencies.
  • Update the test’s local-repo construction to use MavenRepositorySystem.createArtifactRepository(...) instead of ArtifactRepositoryFactory.
  • Update the test-pinned maven-javadoc-plugin from 3.4.0 to 3.12.0 to avoid maven-compat-only Plexus components.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/test/java/org/apache/maven/reporting/exec/TestDefaultMavenReportExecutor.java Updates test setup to avoid maven-compat APIs and bumps the test-loaded javadoc plugin version.
pom.xml Raises Maven/Resolver version properties and removes the test dependency on maven-compat.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@slachiewicz
slachiewicz marked this pull request as draft August 9, 2026 21:21
@slachiewicz
slachiewicz deleted the drop-maven-compat branch August 10, 2026 20:38
@slachiewicz
slachiewicz restored the drop-maven-compat branch August 16, 2026 10:46
@slachiewicz slachiewicz reopened this Aug 16, 2026
@slachiewicz

Copy link
Copy Markdown
Member Author

Reopened with the branch restored; the commit is unchanged and still applies to master. The baseline it depends on is being settled in apache/maven#12709 — this one is only mergeable if 3.9.12 is acceptable for shared components.

This comment was created with AI assistance.

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

Labels

breaking Pull requests that break existing features dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants