Repository navigation
Description
Tracking issue for removing the classes and methods that were already deprecated in Maven 3 and are still shipped on master. It is one block of #7952 (remove old deprecated code); #8177 tracks the maven-compat module as a whole and #13460 tracks the internal move to the v4 API.
The question behind it: which of these can go in a 4.x minor, and which have to wait for the plugins that still call them.
Measured on 2026-11-27 against maven-3.9.x df0ec4930 and master f6c51799d. The usage scan covers the default branches of 131 active repositories: apache/maven-* (without this one), codehaus-plexus and mojohaus.
What is deprecated
maven-3.9.x carries 227 @Deprecated elements in main code: 76 types and 151 members.
| Module (3.9.x) | Deprecated types | Deprecated members |
|---|---|---|
maven-compat |
41 | 33 |
maven-core |
21 | 99 |
maven-artifact |
4 | 5 |
maven-model-builder |
4 | 2 |
maven-settings-builder |
4 | 3 |
maven-resolver-provider |
1 | 7 |
maven-settings |
1 | 0 |
maven-embedder, maven-plugin-api |
0 | 1 each |
Of the 76 types, 73 are still on master under the same name and still deprecated: 66 under compat/ (53 of them in compat/maven-compat) and 7 in impl/maven-core. Three are gone: MavenProfilesBuilder, DefaultMavenProfilesBuilder and MavenResolverModule.
MavenProject (32 members) and MavenSession (16 members) hold a third of the deprecated members.
Who still uses the types
Ten of the 76 types are still imported somewhere in the 131 repositories; 66 have no importer.
| Deprecated type | Main-code files | Repositories (main code) |
|---|---|---|
artifact.repository.ArtifactRepository |
17 | maven-archetype, maven-dependency-plugin, maven-dependency-tree, maven-enforcer, maven-plugin-testing, maven-plugin-tools, maven-project-info-reports-plugin, maven-site-plugin, mojohaus/license-maven-plugin |
artifact.metadata.ArtifactMetadata |
3 | maven-plugin-testing, maven-site-plugin |
artifact.factory.ArtifactFactory |
3 | maven-enforcer, maven-plugin-testing, mojohaus/maven-native |
model.building.ModelSource |
2 | maven-resolver-ant-tasks, mojohaus/flatten-maven-plugin |
artifact.repository.ArtifactRepositoryPolicy |
1 | maven-plugin-testing |
artifact.repository.layout.ArtifactRepositoryLayout |
1 | maven-plugin-testing |
artifact.metadata.AbstractArtifactMetadata |
1 | maven-site-plugin |
plugin.PluginManager |
1 | maven-enforcer |
toolchain.java.DefaultJavaToolChain |
1 | maven-surefire |
artifact.metadata.ArtifactMetadataSource |
0 | tests only, in maven-plugin-tools |
Test code adds ten more repositories, mostly for ArtifactRepository and ArtifactRepositoryPolicy in mocks and stubs.
The 66 types with no importer
maven-compat(41): everything deprecated inartifact.manager,artifact.resolver,profiles,profiles.activation,project,project.inheritance,project.interpolation,project.path,project.validation,execution, plusDefaultArtifactRepository,ManagedVersionMap,LegacyArtifactCollectorandDefaultConflictResolver.maven-core(16):ProjectDependenciesResolver,DefaultProjectDependenciesResolver,ArtifactMetadataRetrievalException,ResolutionGroup,RepositoryCache,ReactorManager,EventDispatcher,EventMonitor,DebugConfigurationListener,ActiveProjectArtifact,AttachedArtifact,PathTranslator,DelegatingLocalArtifactRepository, the legacyrepository.RepositorySystem,MavenSettingsBuilder,DefaultToolchainsBuilder.maven-settings-builder(4):SettingsSource,FileSettingsSource,StringSettingsSource,UrlSettingsSource.maven-model-builder(3):StringModelSource,UrlModelSource,StringSearchModelInterpolator.maven-settings(1):RuntimeInfo.maven-resolver-provider(1):MavenResolverModule, already removed onmaster.
Who still calls the methods
Call sites in main code, read line by line; tests add more in the same repositories.
| Deprecated method | Files | Repositories |
|---|---|---|
MavenProject.getDependencyArtifacts() |
15 | maven-assembly-plugin, maven-dependency-plugin, maven-enforcer, maven-javadoc-plugin, maven-mvnd, maven-release, maven-remote-resources-plugin, maven-war-plugin, mojohaus/aspectj-maven-plugin, mojohaus/license-maven-plugin, mojohaus/versions |
MavenProject.getTestArtifacts() |
3 | maven-javadoc-plugin, maven-surefire, mojohaus/exec-maven-plugin |
MavenProject.getCompileArtifacts(), getRuntimeArtifacts(), getSystemArtifacts() |
1 | mojohaus/exec-maven-plugin |
MavenProject.getReportPlugins() |
2 | maven-enforcer, maven-project-info-reports-plugin |
MavenProject.getReportArtifacts() |
2 | maven-enforcer, maven-release |
MavenProject.getReportArtifactMap(), getExtensionArtifacts(), getExtensionArtifactMap() |
1 each | maven-release |
MavenProject.getScriptSourceRoots() |
1 | maven-plugin-tools |
MavenSession.getContainer() |
1 | maven-enforcer |
MavenSession.getSortedProjects(), lookup*(), getExecutionProperties(), getEventDispatcher(), isUsingPOMsFromFilesystem() |
0 | none |
MavenProjectStub in maven-plugin-testing overrides 22 of the deprecated MavenProject methods.
Per-repository issues
- Move off the Maven API deprecated since Maven 3 maven-archetype#1086
- Move off the Maven API deprecated since Maven 3 maven-assembly-plugin#1425
- Move off the Maven API deprecated since Maven 3 maven-changelog-plugin#269
- Move off the Maven API deprecated since Maven 3 maven-changes-plugin#701
- Move off the Maven API deprecated since Maven 3 maven-checkstyle-plugin#758
- Move off the Maven API deprecated since Maven 3 maven-dependency-plugin#1820
- Move off the Maven API deprecated since Maven 3 maven-dependency-tree#169
- Move off the Maven API deprecated since Maven 3 maven-ejb-plugin#261
- Move off the Maven API deprecated since Maven 3 maven-enforcer#1096
- Move off the Maven API deprecated since Maven 3 maven-javadoc-plugin#1459
- Move off the Maven API deprecated since Maven 3 maven-mvnd#1967
- Move off the Maven API deprecated since Maven 3 maven-plugin-testing#312
- Move off the Maven API deprecated since Maven 3 maven-plugin-tools#1295
- Move off the Maven API deprecated since Maven 3 maven-pmd-plugin#793
- Move off the Maven API deprecated since Maven 3 maven-project-info-reports-plugin#704
- Move off the Maven API deprecated since Maven 3 maven-release#1547
- Move off the Maven API deprecated since Maven 3 maven-remote-resources-plugin#357
- Move off the Maven API deprecated since Maven 3 maven-reporting-exec#191
- Move off the Maven API deprecated since Maven 3 maven-resolver-ant-tasks#219
- Move off the Maven API deprecated since Maven 3 maven-site-plugin#1366
- Move off the Maven API deprecated since Maven 3 maven-surefire#3644
- Move off the Maven API deprecated since Maven 3 maven-war-plugin#694
- Move off the Maven API deprecated since Maven 3 mojohaus/aspectj-maven-plugin#317
- Move off the Maven API deprecated since Maven 3 mojohaus/exec-maven-plugin#592
- Move off the Maven API deprecated since Maven 3 mojohaus/flatten-maven-plugin#588
- Move off the Maven API deprecated since Maven 3 mojohaus/license-maven-plugin#837
- Move off the Maven API deprecated since Maven 3 mojohaus/maven-native#224
- Move off the Maven API deprecated since Maven 3 mojohaus/versions#1513
Out of scope: what only Maven 4 deprecated
master deprecates 492 types in total. The other 419 are the regular Maven 3 plugin API, deprecated in favor of org.apache.maven.api, and 120 of the 492 are imported by 68 of the scanned repositories: ProjectBuilder (89 main-code files in 16 repositories), MavenReportException (66 in 22), ToolchainManager (54 in 15), SettingsDecrypter (35 in 7), MavenXpp3Reader (18 in 15). Those stay for as long as Maven 4 runs Maven 3 plugins and are not part of this issue.
MultiThreadedBuilder is not part of it either: it is not deprecated on any branch, and -T still selects it on master.
Plan
- Scan this repository for uses of the 73 remaining types and the deprecated members, in main code, tests and
its/, and sort each one: no caller, called only fromcompat/, or called fromimpl/. - Remove on
masterwhat has no caller here and no importer in the scanned repositories (labelremoved). - maven-enforcer: move off
PluginManager,ArtifactFactoryandMavenSession.getContainer(). - maven-site-plugin: move off
ArtifactMetadataandAbstractArtifactMetadata. - maven-plugin-testing: drop the stubs for the removed methods.
-
ArtifactRepository: move the nine repositories to Resolver'sRemoteRepositoryandLocalRepository. -
getDependencyArtifacts(): move the 11 repositories togetArtifacts()narrowed to the direct dependencies. -
ModelSource: move maven-resolver-ant-tasks and flatten-maven-plugin toModelSource2. - Mark what still has callers
forRemoval = true, and remove it once the plugin releases are out.
Limits
- The type scan matches
importlines. Same-package use, inline fully qualified names and five files with wildcard Maven imports are not counted. - Only default branches were scanned, not the
-4.xlines of the plugins. - Plugins outside the three organizations are not covered; a type with no importer here can still have users elsewhere.
- Uses inside apache/maven itself are the first item of the plan and are not measured yet.
Activity
Move report executor tests off deprecated repository APIs