Skip to content

Instantly share code, notes, and snippets.

@michael-o
Created March 14, 2023 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michael-o/86957829fe4a2e119d3f2e096ffd1707 to your computer and use it in GitHub Desktop.
Save michael-o/86957829fe4a2e119d3f2e096ffd1707 to your computer and use it in GitHub Desktop.
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