slachiewicz commented on issue #8177: URL: https://github.com/apache/maven/issues/8177#issuecomment-5738098918
Survey of what removing `maven-compat` involves as of `master` [6444044e1f](https://github.com/apache/maven/commit/6444044e1f047acea904f68b0ce32bd32b0b0ea3) (2026-09-18). #1487 is closed as stale; this is the input for a fresh PR, with the work tracked as task lists below. **Core is done.** `impl/**/src/main` has no use of compat classes (#9185). What remains inside apache/maven: - [`apache-maven/pom.xml`](https://github.com/apache/maven/blob/master/apache-maven/pom.xml) bundles it; `impl/maven-cli` has it at test scope; root POM and BOM manage it. - [`extension.xml`](https://github.com/apache/maven/blob/master/impl/maven-core/src/main/resources/META-INF/maven/extension.xml) exports `org.apache.maven:maven-compat`; `Maven3CompatDependenciesValidator` only warns; `DefaultLifecycles` carries a TODO shim for compat's `EmptyLifecycleExecutor`. - ITs: 29 POMs and 30 IT-plugin sources use compat classes (`ArtifactResolver`, `WagonManager`, `ArtifactRepositoryFactory`, v3 toolchain, `ArtifactInstaller`/`ArtifactDeployer`, `MavenProjectBuilder`, `RuntimeInformation`) in `core-it-support/core-it-plugins/*`, `core-it-toolchain` and the fixtures mng-3652, 3684, 3703, 4207, 5445, 6759, gh-11314. **The module is no longer only the Maven 2 layer.** 64 classes that were in maven-core on `maven-3.9.x` now live in maven-compat on `master` and `maven-4.0.x`. Maven 3 plugins never declared maven-compat for them, so dropping the module from the distribution breaks them at runtime: | Group | Classes | Plugins using them in `src/main` on their default branch | |---|---|---| | v3 toolchain API, moved by #9888 in 4.0.0-rc-3; compat's `ToolchainManagerFactory` bridges it onto the v4 `ToolchainManager` | `org.apache.maven.toolchain.*` (16 classes) | surefire, javadoc, pmd, jdeps, jdeprscan, jarsigner, jlink, jmod, invoker, artifact-plugin, toolchains-plugin (`ToolchainManagerPrivate`), maven-compiler-plugin 3.x line | | legacy metadata and manager types | `ArtifactRepositoryMetadata`, `AbstractRepositoryMetadata`, `AbstractArtifactMetadata`, `RepositoryMetadata`, `ProjectArtifactMetadata`, `RepositoryMetadataManager`, `PluginManager` | maven-plugin-plugin `LegacySupport`, maven-site-plugin `SiteDescriptorArtifactMetadata`, maven-dependency-plugin `ResolverUtil`, enforcer `RequirePluginVersions`; javadoc-plugin ≤ 3.4.0 needs `DefaultRepositoryMetadataManager` | Plugin POMs in apache/maven-* still declaring maven-compat (default branches): test scope in checkstyle, javadoc, project-info-reports, release, reporting-exec, war. Those are blocked on the 3.6.3 → 3.9.12 baseline (#12709): maven-core 3.6.3's `DefaultProjectBuildingHelper` needs the compat `RepositorySystem` to boot the test container. Not verified: whether a plugin-declared maven-compat loads in a plugin realm once core stops exporting it, and users outside apache/maven-* (about 60 other Apache projects declare it in a plugin POM). ## Tasks ### Decision - [ ] Choose the shape: stop bundling in the distribution but keep publishing (#10290 direction), or delete the module. `master` only; 4.0.x keeps it. - [ ] Decide which Maven 2-era behaviours the core IT suite still guarantees (drives the IT group below). ### Relocate what Maven 3 plugins still need - [ ] Move the v3 toolchain bridge (`org.apache.maven.toolchain.*`, `ToolchainManagerFactory`) out of maven-compat into maven-core or a small `maven-toolchain-compat`. - [ ] Same call for `ArtifactRepositoryMetadata`, `AbstractRepositoryMetadata`, `AbstractArtifactMetadata`, `RepositoryMetadata`, `ProjectArtifactMetadata`, `RepositoryMetadataManager`, `PluginManager`: restore to core, or fix the four plugins below. ### Plugins (only if the classes are not restored to core) - [ ] maven-site-plugin: `SiteDescriptorArtifactMetadata` as an attached artifact. - [ ] maven-plugin-plugin: drop `LegacySupport` (unneeded since Resolver 1.9). - [ ] maven-dependency-plugin: `ResolverUtil` filter without `ProjectArtifactMetadata`. - [ ] maven-enforcer-plugin: `RequirePluginVersions` on `BuildPluginManager`. ### Core ITs - [ ] Rewrite or delete the 30 IT-plugin sources in `core-it-support/core-it-plugins/*` and `core-it-toolchain`. - [ ] Rewrite or delete the fixtures mng-3652, 3684, 3703, 4207, 5445, 6759, gh-11314. - [ ] Drop the 29 `maven-compat` declarations in `its/**/pom.xml`. ### Core cleanup - [ ] `apache-maven/pom.xml`: stop bundling. - [ ] `impl/maven-cli/pom.xml`: drop the test-scope dependency. - [ ] `extension.xml`: drop the `org.apache.maven:maven-compat` export. - [ ] `Maven3CompatDependenciesValidator`: warning to error. - [ ] `DefaultLifecycles`: remove the `EmptyLifecycleExecutor` shim. - [ ] Root POM, BOM, `compat/pom.xml`: drop the module. ### Plugin POMs - [ ] Settle the 3.9.12 baseline (#12709), then drop the test-scope declarations in checkstyle, javadoc, project-info-reports, release, reporting-exec, war. - [ ] Move javadoc-plugin pins in tests to ≥ 3.12.0. *This comment was created with AI assistance.* -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
