if ( e.getCause() instanceof org.eclipse.aether.transfer.ArtifactNotFoundException )
@Override public File lookupBundle(BundleDependency bundleDependency) { try { if (remoteRepositories.isEmpty()) { throw new RepositoryServiceDisabledException("Repository service has not been configured so it's disabled. " + "To enable it you must configure the set of repositories to use using the system property: " + MULE_REMOTE_REPOSITORIES_PROPERTY); } DefaultArtifact artifact = toArtifact(bundleDependency); ArtifactRequest getArtifactRequest = new ArtifactRequest(); getArtifactRequest.setRepositories(remoteRepositories); getArtifactRequest.setArtifact(artifact); ArtifactResult artifactResult = repositorySystem.resolveArtifact(repositorySystemSession, getArtifactRequest); return artifactResult.getArtifact().getFile(); } catch (ArtifactResolutionException e) { if (e.getCause() instanceof ArtifactNotFoundException) { throw new BundleNotFoundException(e); } else { throw new RepositoryConnectionException("There was a problem connecting to one of the repositories", e); } } }
/** * Creates a new exception with the specified results and detail message. * * @param results The resolution results at the point the exception occurred, may be {@code null}. * @param message The detail message, may be {@code null}. */ public ArtifactResolutionException( List<ArtifactResult> results, String message ) { super( message, getCause( results ) ); this.results = ( results != null ) ? results : Collections.<ArtifactResult> emptyList(); }
/** * Creates a new exception with the specified results and detail message. * * @param results The resolution results at the point the exception occurred, may be {@code null}. * @param message The detail message, may be {@code null}. */ public ArtifactResolutionException( List<ArtifactResult> results, String message ) { super( message, getCause( results ) ); this.results = ( results != null ) ? results : Collections.<ArtifactResult>emptyList(); }
/** * Creates a new exception with the specified results. * * @param results The resolution results at the point the exception occurred, may be {@code null}. */ public ArtifactResolutionException( List<ArtifactResult> results ) { super( getMessage( results ), getCause( results ) ); this.results = ( results != null ) ? results : Collections.<ArtifactResult>emptyList(); }
/** * Creates a new exception with the specified results. * * @param results The resolution results at the point the exception occurred, may be {@code null}. */ public ArtifactResolutionException( List<ArtifactResult> results ) { super( getMessage( results ), getCause( results ) ); this.results = ( results != null ) ? results : Collections.<ArtifactResult> emptyList(); }
Throwable cause = getCause( results ); if ( cause != null )
Throwable cause = getCause( results ); if ( cause != null )
@Override public File lookupBundle(BundleDependency bundleDependency) { try { if (remoteRepositories.isEmpty()) { throw new RepositoryServiceDisabledException("Repository service has not been configured so it's disabled. " + "To enable it you must configure the set of repositories to use using the system property: " + MULE_REMOTE_REPOSITORIES_PROPERTY); } DefaultArtifact artifact = toArtifact(bundleDependency); ArtifactRequest getArtifactRequest = new ArtifactRequest(); getArtifactRequest.setRepositories(remoteRepositories); getArtifactRequest.setArtifact(artifact); ArtifactResult artifactResult = repositorySystem.resolveArtifact(repositorySystemSession, getArtifactRequest); return artifactResult.getArtifact().getFile(); } catch (ArtifactResolutionException e) { if (e.getCause() instanceof ArtifactNotFoundException) { throw new BundleNotFoundException(e); } else { throw new RepositoryConnectionException("There was a problem connecting to one of the repositories", e); } } }