mirror of https://github.com/apache/maven.git
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:
parent
c5495d855a
commit
7f736625f5
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue