Created
March 14, 2023 21:09
-
-
Save michael-o/86957829fe4a2e119d3f2e096ffd1707 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
catch ( ArtifactResolutionException e ) | |
{ | |
if ( e.getCause() instanceof ArtifactNotFoundException ) | |
{ | |
missingDescriptor( session, trace, a, (Exception) e.getCause() ); | |
if ( ( getPolicy( session, a, request ) & ArtifactDescriptorPolicy.IGNORE_MISSING ) != 0 ) | |
{ | |
return null; | |
} | |
} | |
result.addException( e ); | |
throw new ArtifactDescriptorException( result ); | |
} | |
============================0 | |
catch ( org.eclipse.aether.resolution.ArtifactResolutionException e ) | |
{ | |
if ( e.getCause() instanceof org.eclipse.aether.transfer.ArtifactNotFoundException ) | |
{ | |
throw new ArtifactNotFoundException( e.getMessage(), artifact, remoteRepositories, e ); | |
} | |
else | |
{ | |
throw new ArtifactResolutionException( e.getMessage(), artifact, remoteRepositories, e ); | |
} | |
} | |
============================= | |
catch ( org.eclipse.aether.resolution.ArtifactResolutionException e ) | |
{ | |
if ( e.getResults().get( 0 ).isMissing() && allowStubModel ) | |
{ | |
return build( null, createStubModelSource( artifact ), config ); | |
} | |
throw new ProjectBuildingException( artifact.getId(), | |
"Error resolving project artifact: " + e.getMessage(), e ); | |
} | |
============================== | |
private void process( DefaultDependencyResolutionResult result, Collection<ArtifactResult> results ) | |
{ | |
for ( ArtifactResult ar : results ) | |
{ | |
DependencyNode node = ar.getRequest().getDependencyNode(); | |
if ( ar.isResolved() ) | |
{ | |
result.addResolvedDependency( node.getDependency() ); | |
} | |
else | |
{ | |
result.setResolutionErrors( node.getDependency(), ar.getExceptions() ); | |
} | |
} | |
} | |
============================== | |
if (e.getCause() instanceof ArtifactNotFoundException) { | |
throw new SiteToolException("The skin does not exist", e.getCause()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment