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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.2
    • Fix Version/s: 3.0.3
    • Labels:
      None
    • Environment:
      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

            People

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

              Dates

              • Created:
                Updated:
                Resolved: