o Fixed artifact resolver to deliver root artifact first to retain class path order

git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@778141 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-05-24 13:16:45 +00:00
parent ca51f586cd
commit fa03325f35
2 changed files with 10 additions and 2 deletions

View File

@ -89,6 +89,11 @@ public class ArtifactResolutionResult
return ( artifacts != null ) ? artifacts : Collections.<Artifact> emptySet();
}
public void setArtifacts( Set<Artifact> artifacts )
{
this.artifacts = artifacts;
}
public void addRequestedArtifact( Artifact artifact )
{
if ( requestedArtifacts == null )

View File

@ -515,8 +515,11 @@ public class DefaultArtifactResolver
// have been resolved.
if ( request.isResolveRoot() && !isDummy( request ) )
{
// Add the root artifact
result.addArtifact( rootArtifact );
// Add the root artifact (as the first artifact to retain logical order of class path!)
Set<Artifact> allArtifacts = new LinkedHashSet<Artifact>();
allArtifacts.add( rootArtifact );
allArtifacts.addAll( result.getArtifacts() );
result.setArtifacts( allArtifacts );
}
return result;