throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result );
private ArtifactDescriptorResult getArtifactDescription(ArtifactDescriptorRequest request) { ArtifactDescriptorResult descriptorResult = null; try { descriptorResult = system.readArtifactDescriptor(session, request); } catch (ArtifactDescriptorException e) { LOG.warn("Can't get artifact description: {}", request); if (LOG.isDebugEnabled()) LOG.debug(e.getMessage(), e); } return descriptorResult; }
/** * Creates a new exception with the specified result and detail message. * * @param result The descriptor result at the point the exception occurred, may be {@code null}. * @param message The detail message, may be {@code null}. */ public ArtifactDescriptorException( ArtifactDescriptorResult result, String message ) { super( message, getCause( result ) ); this.result = result; }
e.printStackTrace(); } catch (ArtifactDescriptorException e) { e.printStackTrace(); } catch (ArtifactResolutionException e) { e.printStackTrace();
final org.eclipse.aether.artifact.Artifact artifact = ((ArtifactDescriptorException) depedencyResolutionException).getResult().getArtifact(); if (!artifact.equals(lastArtifact)) { tryRemoveLocalArtifact(artifact);
e.printStackTrace(); } catch (ArtifactDescriptorException e2) { e2.printStackTrace(); } catch (ArtifactResolutionException e) { e.printStackTrace();
when(projectBuildingResult.getDependencyResolutionResult()).thenReturn(drr); when(drr.getCollectionErrors()).thenReturn(list); when(exception.getResult()).thenReturn(result);
throw new ArtifactDescriptorException( result, e.getMessage(), e );
private boolean hasTransitiveSnapshots(Dependency dependency) throws MojoFailureException { ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest(); descriptorRequest.setArtifact( new DefaultArtifact(dependency.getGroupId(), dependency.getArtifactId(), dependency.getClassifier(), dependency.getType(), dependency.getVersion())); descriptorRequest.setRepositories(remoteRepos); try { ArtifactDescriptorResult result = repoSystem.readArtifactDescriptor(repoSession, descriptorRequest); Optional<org.eclipse.aether.graph.Dependency> snapshotDependency = result.getDependencies().stream() .filter(d -> d.getArtifact().isSnapshot()) .findFirst(); return snapshotDependency.isPresent(); } catch (ArtifactDescriptorException e) { throw new MojoFailureException(e.getMessage(), e); } }
/** * Creates a new exception with the specified result and detail message. * * @param result The descriptor result at the point the exception occurred, may be {@code null}. * @param message The detail message, may be {@code null}. */ public ArtifactDescriptorException( ArtifactDescriptorResult result, String message ) { super( message, getCause( result ) ); this.result = result; }
e.printStackTrace(); } catch (ArtifactDescriptorException e) { e.printStackTrace(); } catch (ArtifactResolutionException e) { e.printStackTrace();
throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result );
/** * Resolve artifact * @param artifact {@link Artifact} for resolve its dependencies * @return {@link List<ArtifactResult>} of resolved artifact * @throws IllegalArgumentException if artifact is null */ public List<ArtifactResult> resolveArtifact(Artifact artifact) { Args.notNull(artifact, "artifact"); ArtifactDescriptorRequest descriptorRequest = createArtifactDescriptionRequest(artifact); ArtifactDescriptorResult descriptorResult = null; try { descriptorResult = system.readArtifactDescriptor(session, descriptorRequest); } catch (ArtifactDescriptorException e) { if (LOG.isDebugEnabled()) LOG.debug(e.getMessage(), e); } Set<ArtifactRequest> requests = createArtifactRequests(descriptorResult); return resolveArtifactRequests(requests); }
/** * Creates a new exception with the specified result. * * @param result The descriptor result at the point the exception occurred, may be {@code null}. */ public ArtifactDescriptorException( ArtifactDescriptorResult result ) { super( "Failed to read artifact descriptor" + ( result != null ? " for " + result.getRequest().getArtifact() : "" ), getCause( result ) ); this.result = result; }
throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result );
private org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult resolveArtifact( ProjectBuildingRequest buildingRequest, Artifact aetherArtifact ) throws ArtifactResolverException // CHECKSTYLE_ON: LineLength { @SuppressWarnings( "unchecked" ) List<RemoteRepository> aetherRepositories = (List<RemoteRepository>) Invoker.invoke( RepositoryUtils.class, "toRepos", List.class, buildingRequest.getRemoteRepositories() ); RepositorySystemSession session = (RepositorySystemSession) Invoker.invoke( buildingRequest, "getRepositorySession" ); try { // use descriptor to respect relocation ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest( aetherArtifact, aetherRepositories, null ); ArtifactDescriptorResult descriptorResult = repositorySystem.readArtifactDescriptor( session, descriptorRequest ); ArtifactRequest request = new ArtifactRequest( descriptorResult.getArtifact(), aetherRepositories, null ); return new Maven31ArtifactResult( repositorySystem.resolveArtifact( session, request ) ); } catch ( ArtifactDescriptorException e ) { throw new ArtifactResolverException( e.getMessage(), e ); } catch ( ArtifactResolutionException e ) { throw new ArtifactResolverException( e.getMessage(), e ); } }
/** * Creates a new exception with the specified result. * * @param result The descriptor result at the point the exception occurred, may be {@code null}. */ public ArtifactDescriptorException( ArtifactDescriptorResult result ) { super( "Failed to read artifact descriptor" + ( result != null ? " for " + result.getRequest().getArtifact() : "" ), getCause( result ) ); this.result = result; }
throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result );
throw new DependencyCollectionException( result, e.getMessage() );
throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result ); throw new ArtifactDescriptorException( result );