Skip to content

Move off the Maven API deprecated since Maven 3 #312

Backlog

Description

@slachiewicz

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
ArtifactFactory MavenProjectStub.java:33
ArtifactMetadata ArtifactStub.java:27, StubArtifactRepository.java:26
ArtifactRepository ArtifactStub.java:28, MavenProjectStub.java:34, StubArtifactRepository.java:27
ArtifactRepositoryLayout StubArtifactRepository.java:30
ArtifactRepositoryPolicy StubArtifactRepository.java:28

Test code

Deprecated API Where
ArtifactRepository ExpressionEvaluatorMojo.java:21

MavenProjectStub also overrides 22 deprecated MavenProject methods; those overrides go once the methods are removed.

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:

  • ArtifactFactory: Resolver's DefaultArtifact, with ArtifactHandlerManager for the type lookup.
  • ArtifactMetadata: Resolver's org.eclipse.aether.metadata.Metadata.
  • ArtifactRepository: Resolver's RemoteRepository (project.getRemoteProjectRepositories()), and session.getRepositorySession() for the local repository.
  • ArtifactRepositoryLayout: no counterpart; Resolver handles repository layouts itself.
  • ArtifactRepositoryPolicy: Resolver's RepositoryPolicy.

Before opening a pull request, run the build with its tests locally: mvn verify, with -Prun-its where the repository has integration tests.

Activity

  1. added
    help wanted
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedmaintenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions