o the artifact resolver should continue with the next artifact in the

resolution group even after it could not find one, and throw an exception at
  the end that lists all the artifacts that could not be found.

  http://jira.codehaus.org/browse/MNG-1198



git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@328782 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2005-10-27 04:00:18 +00:00
parent c5495d855a
commit 7f736625f5
1 changed files with 22 additions and 1 deletions

View File

@ -224,10 +224,31 @@ public class DefaultArtifactResolver
localRepository, remoteRepositories, source, filter,
listeners );
List missingArtifacts = new ArrayList();
for ( Iterator i = artifactResolutionResult.getArtifactResolutionNodes().iterator(); i.hasNext(); )
{
ResolutionNode node = (ResolutionNode) i.next();
resolve( node.getArtifact(), node.getRemoteRepositories(), localRepository );
try
{
resolve( node.getArtifact(), node.getRemoteRepositories(), localRepository );
}
catch ( ArtifactNotFoundException anfe )
{
getLogger().debug( anfe.getMessage() );
missingArtifacts.add( node.getArtifact() );
}
}
if ( missingArtifacts.size() > 0 )
{
String message = "required artifacts missing:\n";
for( Iterator i=missingArtifacts.iterator(); i.hasNext(); )
{
Artifact missingArtifact = (Artifact) i.next();
message += " " + missingArtifact.getId() + "\n";
}
message += "\nfor the artifact:";
throw new ArtifactResolutionException( message, originatingArtifact, remoteRepositories );
}
return artifactResolutionResult;