o Improved error reporting

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@750906 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-03-06 14:03:38 +00:00
parent 048808f308
commit ba677b1fb9
2 changed files with 13 additions and 2 deletions

View File

@ -162,7 +162,8 @@ public class DefaultArtifactResolver
{ {
if ( !isOnline() ) if ( !isOnline() )
{ {
throw new ArtifactNotFoundException( "The repository system is offline.", artifact ); throw new ArtifactResolutionException( "The repository system is offline and the artifact "
+ artifact + " is not available in the local repository.", artifact );
} }
try try

View File

@ -695,7 +695,17 @@ public class DefaultMavenProjectBuilder
Artifact artifactParent = repositorySystem.createParentArtifact( domainModel.getParentGroupId(), domainModel.getParentArtifactId(), domainModel.getParentVersion() ); Artifact artifactParent = repositorySystem.createParentArtifact( domainModel.getParentGroupId(), domainModel.getParentArtifactId(), domainModel.getParentVersion() );
ArtifactResolutionResult result = repositorySystem.resolve( new ArtifactResolutionRequest( artifactParent, localRepository, remoteRepositories ) ); ArtifactResolutionRequest request = new ArtifactResolutionRequest( artifactParent, localRepository, remoteRepositories );
ArtifactResolutionResult result = repositorySystem.resolve( request );
try
{
resolutionErrorHandler.throwErrors( request, result );
}
catch ( ArtifactResolutionException e )
{
throw (IOException) new IOException( "The parent POM " + artifactParent
+ " could not be retrieved from any repository" ).initCause( e );
}
PomClassicDomainModel parentDomainModel = new PomClassicDomainModel( artifactParent.getFile() ); PomClassicDomainModel parentDomainModel = new PomClassicDomainModel( artifactParent.getFile() );