mirror of https://github.com/apache/maven.git
o Reused the error handling component
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@750043 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
96c06c4f1b
commit
012a6447c8
|
@ -70,6 +70,9 @@ public class DefaultArtifactResolver
|
|||
@Requirement
|
||||
private ArtifactCollector artifactCollector;
|
||||
|
||||
@Requirement
|
||||
private ResolutionErrorHandler resolutionErrorHandler;
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Implementation
|
||||
// ----------------------------------------------------------------------
|
||||
|
@ -323,33 +326,7 @@ public class DefaultArtifactResolver
|
|||
// That's right lets just let it rip right here and send a big incomprehensible blob of text at unsuspecting
|
||||
// users. Bad dog!
|
||||
|
||||
// Metadata cannot be found
|
||||
|
||||
if ( result.hasMetadataResolutionExceptions() )
|
||||
{
|
||||
throw result.getMetadataResolutionException( 0 );
|
||||
}
|
||||
|
||||
// Metadata cannot be retrieved
|
||||
|
||||
// Cyclic Dependency Error
|
||||
|
||||
if ( result.hasCircularDependencyExceptions() )
|
||||
{
|
||||
throw result.getCircularDependencyException( 0 );
|
||||
}
|
||||
|
||||
// Version Range Violation
|
||||
|
||||
if ( result.hasVersionRangeViolations() )
|
||||
{
|
||||
throw result.getVersionRangeViolation( 0 );
|
||||
}
|
||||
|
||||
if ( result.getMissingArtifacts().size() > 0 )
|
||||
{
|
||||
throw new MultipleArtifactsNotFoundException( request.getArtifact(), result.getMissingArtifacts(), request.getRemoteRepostories() );
|
||||
}
|
||||
resolutionErrorHandler.throwErrors( request, result );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue