You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org> on 2011/02/23 17:26:22 UTC

[jira] Closed: (MNG-4987) [regression] LATEST, RELEASE or SNAPSHOT version picked from wrong repository when resolution order does not match timestamp order

     [ http://jira.codehaus.org/browse/MNG-4987?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MNG-4987.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 3.0.3
         Assignee: Benjamin Bentmann

Good catch, fixed in [1073807|http://svn.apache.org/viewvc?view=revision&revision=1073807], and given SNAPSHOT resolution is also affected, we can safely call this a major bug.

> [regression] LATEST, RELEASE or SNAPSHOT version picked from wrong repository when resolution order does not match timestamp order
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-4987
>                 URL: http://jira.codehaus.org/browse/MNG-4987
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Artifacts and Repositories
>    Affects Versions: 3.0.2
>         Environment: Ubuntu 10.10
>            Reporter: Michael Hartmeier
>            Assignee: Benjamin Bentmann
>             Fix For: 3.0.3
>
>
> In maven-aether-provider 3.0.2, DefaultVersionResolver, line 378ff says
> {noformat}
>     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;
>         }
>     }
> {noformat}
> If I understand correctly, you should add 
>             
> {noformat}
>             info.timestamp = timestamp
> {noformat}
> to the else part. Otherwise, you'll use a wrong timestamp in future calls to this method.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira