Uploaded image for project: '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
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.1
    • Fix Version/s: 1.1
    • Component/s: Standard Rules
    • Labels:
      None

      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
        erikgb 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
        erikgb 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
        rocketraman 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
        rocketraman 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
        stephan202 Stephan Schroevers added a comment -

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

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

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

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

        +1

        Show
        tinamou Marek Kasztelnik added a comment - +1
        Hide
        rocketraman 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
        rocketraman 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
        rocketraman 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
        rocketraman 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
        rocketraman Raman Gupta added a comment -

        Patch as suggested by OP.

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

        Fixed in r1335761

        Show
        pgier Paul Gier added a comment - Fixed in r1335761

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development