Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-4987

[regression] LATEST, RELEASE or SNAPSHOT version picked from wrong repository when resolution order does not match timestamp order

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.2
    • 3.0.3
    • None
    • Ubuntu 10.10

    Description

      In maven-aether-provider 3.0.2, DefaultVersionResolver, line 378ff says

          private void merge( String key, Map<String, VersionInfo> infos, String timestamp, String version,
                              ArtifactRepository repository )
          {
              VersionInfo info = infos.get( key );
              if ( info == null )
              {
                  info = new VersionInfo( timestamp, version, repository );
                  infos.put( key, info );
              }
              else if ( info.isOutdated( timestamp ) )
              {
                  info.version = version;
                  info.repository = repository;
              }
          }
      

      If I understand correctly, you should add

                  info.timestamp = timestamp
      

      to the else part. Otherwise, you'll use a wrong timestamp in future calls to this method.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            bentmann Benjamin Bentmann
            mlhartme Michael Hartmeier
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment