Maven Enforcer Plugin
  1. Maven Enforcer Plugin
  2. MENFORCER-118

DependencyConvergence gets better if it doesn't fail on snapshots of same baseVersion

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.1
    • Fix Version/s: 1.1
    • Component/s: Standard Rules
    • Labels:
      None
    • Number of attachments :
      1

      Description

      The DependencyVersionMap used by DependencyConvergense uses node.getArtifact().getVersion() when comparing versions. This makes the rule fail more often than needed because the version compare doens't ignore the fact that some snapshots may have been resolved to timestamp. If the code was node.getArtifact().getBaseVersion() instead then DependencyConvergense would only fail on real version mismatches.

        Activity

        Hide
        Erik Godding Boye added a comment -

        I think this should be reported as a bug, and not an improvement. Maven 3 enforces timestamped versions, which makes the dependency converge rule almost useless with Maven 3 - because of this bug. The priority could also be lifted....

        Show
        Erik Godding Boye added a comment - I think this should be reported as a bug, and not an improvement. Maven 3 enforces timestamped versions, which makes the dependency converge rule almost useless with Maven 3 - because of this bug. The priority could also be lifted....
        Hide
        Raman Gupta added a comment -

        Agree with Erik, this is a show-stopper for timestamped snapshot use. See my StackOverflow question here for a repeatable test scenario: http://stackoverflow.com/questions/8662129/maven-unique-snapshots-and-dependency-convergence

        Show
        Raman Gupta added a comment - Agree with Erik, this is a show-stopper for timestamped snapshot use. See my StackOverflow question here for a repeatable test scenario: http://stackoverflow.com/questions/8662129/maven-unique-snapshots-and-dependency-convergence
        Hide
        Stephan Schroevers added a comment -

        And another +1. Indeed, this is a show-stopper when using Maven 3.

        Show
        Stephan Schroevers added a comment - And another +1. Indeed, this is a show-stopper when using Maven 3.
        Hide
        Raman Gupta added a comment -

        Is there a particular reason this change isn't being made?

        Show
        Raman Gupta added a comment - Is there a particular reason this change isn't being made?
        Hide
        Marek Kasztelnik added a comment -

        +1

        Show
        Marek Kasztelnik added a comment - +1
        Hide
        Raman Gupta added a comment -

        Of course, the other question is: why does Maven resolve some snapshot dependencies to a timestamped version, and others not? It seems to resolve direct dependencies on "-SNAPSHOT" to a unique timestamped version, but transitive dependencies to a non-unique version. Perhaps that is the real bug that needs to be fixed?

        Show
        Raman Gupta added a comment - Of course, the other question is: why does Maven resolve some snapshot dependencies to a timestamped version, and others not? It seems to resolve direct dependencies on "-SNAPSHOT" to a unique timestamped version, but transitive dependencies to a non-unique version. Perhaps that is the real bug that needs to be fixed?
        Hide
        Raman Gupta added a comment -

        In the meantime, until this is fixed I have forked the Maven enforcer plugin trunk, and applied the change suggested by the OP. The source is available here:

        https://github.com/vivosys/maven-enforcer-plugin/tree/menforcer-118

        Show
        Raman Gupta added a comment - In the meantime, until this is fixed I have forked the Maven enforcer plugin trunk, and applied the change suggested by the OP. The source is available here: https://github.com/vivosys/maven-enforcer-plugin/tree/menforcer-118
        Hide
        Raman Gupta added a comment -

        Patch as suggested by OP.

        Show
        Raman Gupta added a comment - Patch as suggested by OP.
        Hide
        Paul Gier added a comment -

        Fixed in r1335761

        Show
        Paul Gier added a comment - Fixed in r1335761

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Poul Bildsøe
          • Votes:
            8 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: