Skip to content

[MNG-6096] Deprecate DefaultArtifactVersion class #7346

Open

Description

@jira-importer

Karl Heinz Marbaise opened MNG-6096 and commented

The DefaultArtifactVersion class parses the version of the artifacts but in many situations it does not work correctly.

Furthermore based on the references and hints given here:

https://cwiki.apache.org/confluence/display/MAVENOLD/Versioning


Affects: needing-scrub-3.4.0-fallout

Remote Links:

Activity

  1. jira-importer commented on Sep 24, 2016

    @jira-importer
    Author
  2. jira-importer commented on Jan 9, 2017

    @jira-importer
    Author

    Stephen Connolly commented

    Maven 3.4.0 has been dropped. See this thread for more details.

    This issue will need to be re-scheduled for a Maven release in the (hopefully near) future.

  3. jira-importer commented on Apr 22, 2019

    @jira-importer
    Author

    Joseph Walton commented

    This looks like a trivial change to reschedule; what's the long-term story here? Is the alternative ComparableVersion?

    DefaultArtifactVersion is still used throughout Maven:

    maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java
    maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java
    maven-compat/src/main/java/org/apache/maven/execution/DefaultRuntimeInformation.java
    maven-compat/src/main/java/org/apache/maven/profiles/activation/JdkPrefixProfileActivator.java
    maven-compat/src/main/java/org/apache/maven/repository/metadata/DefaultGraphConflictResolutionPolicy.java
    maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
    maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcherFactory.java
    maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
    

    and, with DefaultVersion used in API, it doesn't seem like it's possible to remove it without either breaking API or providing a new concrete implementation.

  4. added
    priority:minor
    on Jul 6, 2025
  5. modified the milestones: , 4.x on Jul 7, 2025
  6. Shreekar-cloud commented on Oct 19, 2026

    @Shreekar-cloud
    Contributor

    Hi, I’d like to take this if it’s still wanted. DefaultArtifactVersion currently isn’t deprecated on master. It lives in compat/maven-artifact and all ten of its main-code usages are under compat/. Joseph Walton asked in 2019 what the long-term replacement is and I couldn’t find an answer. What should the @deprecated note point to: ComparableVersion, or the Maven 4 API version classes? And is deprecating it in the compat layer still desired, given the discussion about removing maven-compat? I’ll wait for a maintainer’s answer before opening a PR.

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

    maintenancepriority:minor

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions