o applying patch provided by Garret Conaty in issue

MNG-1207
  
  ---
  
  ResolutionNode.getDependencyTrail calls artifact.selectVersion(artifact.getSelectedVersion()) 
  even w/o checking artifact.isSelectedVersionKnown().
  
  ---
  


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@326225 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2005-10-18 20:39:53 +00:00
parent d4887e95ff
commit b874063d65
1 changed files with 16 additions and 0 deletions

View File

@ -157,6 +157,21 @@ public class DefaultArtifactCollector
}
previous.getArtifact().setVersionRange( newRange );
node.getArtifact().setVersionRange( currentRange.restrict( previousRange ) );
//Select an appropriate available version from the (now restricted) range
//Note this version was selected before to get the appropriate POM
//But it was reset by the call to setVersionRange on restricting the version
ResolutionNode[] resetNodes = {previous, node};
for ( int j = 0; j < 2; j++ )
{
Artifact resetArtifact = resetNodes[j].getArtifact();
if ( resetArtifact.getVersion() == null && resetArtifact.getVersionRange() != null && resetArtifact.getAvailableVersions() != null )
{
resetArtifact.selectVersion( resetArtifact.getVersionRange().matchVersion( resetArtifact.getAvailableVersions() ).toString() );
fireEvent( ResolutionListener.SELECT_VERSION_FROM_RANGE, listeners, resetNodes[j] );
}
}
}
// Conflict Resolution
@ -225,6 +240,7 @@ public class DefaultArtifactCollector
}
VersionRange versionRange = artifact.getVersionRange();
version = versionRange.matchVersion( versions );
if ( version == null )