Maven
  1. Maven
  2. MNG-2434

Local snapshots should be preferred over remote ones

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 2.0.6
    • Component/s: Dependencies
    • Labels:
      None

      Description

      If you're build a project with snapshots, m2 tries to download the newest versions of the snapshots even if the local ones are newer. Interestingly later on, the local versions are used. So the download is useless.
      A complex test case for this is the Cocoon project where nearly all modules are snapshot and locally build.

        Activity

        Carsten Ziegeler created issue -
        Joerg Schaible made changes -
        Field Original Value New Value
        Link This issue duplicates MNG-1908 [ MNG-1908 ]
        Hide
        Joerg Schaible added a comment -

        It downloads only the metadata, but never the SNAPSHOT ... see MNG-1908

        Show
        Joerg Schaible added a comment - It downloads only the metadata, but never the SNAPSHOT ... see MNG-1908
        Hide
        Brett Porter added a comment -

        Carsten - can you confirm if this is really a dupe of MNG-1908? Are you using the plain SNAPSHOT on the remote server, or are you using the timestamped snapshots on the remote server?

        Show
        Brett Porter added a comment - Carsten - can you confirm if this is really a dupe of MNG-1908 ? Are you using the plain SNAPSHOT on the remote server, or are you using the timestamped snapshots on the remote server?
        Hide
        Carsten Ziegeler added a comment -

        I don't think that this is a dupe: It really downloads the artifacts sometimes not just the poms. We are using the plain SNAPSHOT version. Now perhaps the interesting part is that this happens during a build where these artifacts have just been created and put in the local repository. So a simplified example is, you have two modules A and B, both have the version as SNAPSHOT and B depends on A. Now you build both modules at once, first A gets build and is installed in the local repo, then B gets build, downloads a snapshot of A from the remote server, builds and then uses the local version of B. I'm not exactly sure of this last part, but upto now, everytime changes locally done to A where available in B although B downloaded a SNAPSHOT of A which could not have these local changes.
        This does not happen always, but from time to time.

        Show
        Carsten Ziegeler added a comment - I don't think that this is a dupe: It really downloads the artifacts sometimes not just the poms. We are using the plain SNAPSHOT version. Now perhaps the interesting part is that this happens during a build where these artifacts have just been created and put in the local repository. So a simplified example is, you have two modules A and B, both have the version as SNAPSHOT and B depends on A. Now you build both modules at once, first A gets build and is installed in the local repo, then B gets build, downloads a snapshot of A from the remote server, builds and then uses the local version of B. I'm not exactly sure of this last part, but upto now, everytime changes locally done to A where available in B although B downloaded a SNAPSHOT of A which could not have these local changes. This does not happen always, but from time to time.
        Brett Porter made changes -
        Link This issue duplicates MNG-1908 [ MNG-1908 ]
        Hide
        David Hay added a comment -

        We see this behavior as well in Maven 2.0.4. If a new SNAPSHOT version of an artifact is deployed to the remote repository and then I do a 'mvn install' of the same artifact, building a project that depends on that SNAPSHOT will use the version in the remote repository instead of the one I just installed into my local repository (which is newer than the one on the remote repository)

        Show
        David Hay added a comment - We see this behavior as well in Maven 2.0.4. If a new SNAPSHOT version of an artifact is deployed to the remote repository and then I do a 'mvn install' of the same artifact, building a project that depends on that SNAPSHOT will use the version in the remote repository instead of the one I just installed into my local repository (which is newer than the one on the remote repository)
        Jason van Zyl made changes -
        Fix Version/s Reviewed [ 13555 ]
        Hide
        Kenney Westerhof added a comment -

        Could this be tested again with 2.0.6?

        I think there's a fix for another issue that may solve this one as a side-effect.

        Show
        Kenney Westerhof added a comment - Could this be tested again with 2.0.6? I think there's a fix for another issue that may solve this one as a side-effect.
        Hide
        Carsten Ziegeler added a comment -

        Yes, this does not happen with maven 2.0.6 any more, so it seems that this is fixed now.

        Show
        Carsten Ziegeler added a comment - Yes, this does not happen with maven 2.0.6 any more, so it seems that this is fixed now.
        kenneyw made changes -
        Resolution Fixed [ 1 ]
        Fix Version/s 2.0.6 [ 13010 ]
        Fix Version/s Reviewed Pending Version Assignment [ 13555 ]
        Status Open [ 1 ] Closed [ 6 ]
        Hide
        Kenney Westerhof added a comment -

        Thanks for testing!

        Marking this closed and fixed in 2.0.6.

        Show
        Kenney Westerhof added a comment - Thanks for testing! Marking this closed and fixed in 2.0.6.
        Mark Thomas made changes -
        Project Import Sun Apr 05 08:49:45 UTC 2015 [ 1428223785911 ]
        Mark Thomas made changes -
        Workflow jira [ 12713040 ] Default workflow, editable Closed status [ 12752383 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 21:45:26 UTC 2015 [ 1428270326204 ]
        Mark Thomas made changes -
        Workflow jira [ 12949645 ] Default workflow, editable Closed status [ 12985862 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        340d 5h 33m 1 kenneyw 16/Jun/07 14:35

          People

          • Assignee:
            Unassigned
            Reporter:
            Carsten Ziegeler
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development