Remove maven-compat, which needed three things rather than one - #158
Remove maven-compat, which needed three things rather than one#158slachiewicz wants to merge 1 commit into
Conversation
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.
There was a problem hiding this comment.
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
mavenVersionto 3.9.12 and alignresolverVersionto 1.9.25, then removeorg.apache.maven:maven-compatfrom test dependencies. - Update the test’s local-repo construction to use
MavenRepositorySystem.createArtifactRepository(...)instead ofArtifactRepositoryFactory. - Update the test-pinned
maven-javadoc-pluginfrom 3.4.0 to 3.12.0 to avoidmaven-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.
|
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. |
Nothing here imports
maven-compat, but three things reached it indirectly.maven-coremovedDefaultProjectBuildingHelper's legacyorg.apache.maven.repository.RepositorySystemfield toMavenRepositorySystemin 3.9.12 exactly (3afbdb8f76), so that is wheremavenVersionlands, with theresolverVersion1.9.25 that 3.9.12 itself ships. The test's local repository moves fromArtifactRepositoryFactoryto the staticMavenRepositorySystem.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.verifyrather thantestbecause 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.