Repository navigation
Backlog
Labels
Description
Part of apache/maven#14157, which tracks removing the classes and methods that have been deprecated since Maven 3. This repository still uses the ones listed here (master on 2026-11-27).
Main code
| Deprecated API | Where |
|---|---|
ArtifactRepository |
PurgeLocalRepositoryMojo.java:42, ResolvePluginsMojo.java:37 |
MavenProject.getDependencyArtifacts() |
AnalyzeDepMgt.java:162, AbstractDependencyFilterMojo.java:392 |
Test code
| Deprecated API | Where |
|---|---|
ArtifactMetadata |
TestCopyDependenciesMojo2.java:37 |
ArtifactRepository |
SnapshotArtifactRepositoryMetadata.java:22, PurgeLocalRepositoryMojoTest.java:28, TestCopyDependenciesMojo2.java:38 |
ArtifactRepositoryLayout |
TestCopyDependenciesMojo2.java:41 |
ArtifactRepositoryPolicy |
TestCopyDependenciesMojo2.java:39 |
MavenProject.setDependencyArtifacts() |
TestCollectMojo.java (2 uses), TestAnalyzeDepMgt.java:89, ResolveAfterFilteringTest.java:89, TestCopyDependenciesMojo.java:772, TestRenderDependenciesMojo.java:146, ResolveDependencySourcesMojoTest.java:74, TestResolveMojo.java:59, TestTreeMojo.java (2 uses) |
Scope
Replace each use with a non-deprecated counterpart, without changing behavior or parameters. Most of these have no replacement named in their Javadoc, so take the list as a starting point:
ArtifactRepository: Resolver'sRemoteRepository(project.getRemoteProjectRepositories()), andsession.getRepositorySession()for the local repository.MavenProject.getDependencyArtifacts():getArtifacts()narrowed to the direct dependencies.ArtifactMetadata: Resolver'sorg.eclipse.aether.metadata.Metadata.ArtifactRepositoryLayout: no counterpart; Resolver handles repository layouts itself.ArtifactRepositoryPolicy: Resolver'sRepositoryPolicy.MavenProject.setDependencyArtifacts():setArtifacts().
Before opening a pull request, run the build with its tests locally: mvn verify, with -Prun-its where the repository has integration tests.
Activity
Irasha-Senarathna commentedon Nov 28, 2026
Hi @slachiewicz, I'd like to work on this one.I'll go through the uses listed above and swap them for the Resolver counterparts you suggested, without changing behavior or parameters. I'll double-check that getArtifacts() narrowed to direct dependencies gives the same set as getDependencyArtifacts() in each mojo, and I'll run mvn -Prun-its verify before opening the PR.