private File getFile( RepositorySystemSession session, Artifact artifact, File file ) throws ArtifactTransferException { if ( artifact.isSnapshot() && !artifact.getVersion().equals( artifact.getBaseVersion() ) && ConfigUtils.getBoolean( session, true, CONFIG_PROP_SNAPSHOT_NORMALIZATION ) ) { String name = file.getName().replace( artifact.getVersion(), artifact.getBaseVersion() ); File dst = new File( file.getParent(), name ); boolean copy = dst.length() != file.length() || dst.lastModified() != file.lastModified(); if ( copy ) { try { fileProcessor.copy( file, dst ); dst.setLastModified( file.lastModified() ); } catch ( IOException e ) { throw new ArtifactTransferException( artifact, null, e ); } } file = dst; } return file; }
private File getFile( RepositorySystemSession session, Artifact artifact, File file ) throws ArtifactTransferException { if ( artifact.isSnapshot() && !artifact.getVersion().equals( artifact.getBaseVersion() ) && ConfigUtils.getBoolean( session, true, CONFIG_PROP_SNAPSHOT_NORMALIZATION ) ) { String name = file.getName().replace( artifact.getVersion(), artifact.getBaseVersion() ); File dst = new File( file.getParent(), name ); boolean copy = dst.length() != file.length() || dst.lastModified() != file.lastModified(); if ( copy ) { try { fileProcessor.copy( file, dst ); dst.setLastModified( file.lastModified() ); } catch ( IOException e ) { throw new ArtifactTransferException( artifact, null, e ); } } file = dst; } return file; }
private ArtifactTransferException newException(String error, Artifact artifact, RemoteRepository repository) { if (error == null || error.length() <= 0) { return new ArtifactNotFoundException(artifact, repository, "Failure to find " + artifact + " in " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced"); } else { return new ArtifactTransferException(artifact, repository, "Failure to transfer " + artifact + " from " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced. Original error: " + error); } }
private ArtifactTransferException newException(String error, Artifact artifact, RemoteRepository repository) { if (error == null || error.length() <= 0) { return new ArtifactNotFoundException(artifact, repository, "Failure to find " + artifact + " in " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced"); } else { return new ArtifactTransferException(artifact, repository, "Failure to transfer " + artifact + " from " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced. Original error: " + error); } }
private ArtifactTransferException newException( String error, Artifact artifact, RemoteRepository repository ) { if ( error == null || error.length() <= 0 ) { return new ArtifactNotFoundException( artifact, repository, "Failure to find " + artifact + " in " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced", true ); } else { return new ArtifactTransferException( artifact, repository, "Failure to transfer " + artifact + " from " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced. Original error: " + error, true ); } }
private ArtifactTransferException newException( String error, Artifact artifact, RemoteRepository repository ) { if ( error == null || error.length() <= 0 ) { return new ArtifactNotFoundException( artifact, repository, "Failure to find " + artifact + " in " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced", true ); } else { return new ArtifactTransferException( artifact, repository, "Failure to transfer " + artifact + " from " + repository.getUrl() + " was cached in the local repository, " + "resolution will not be reattempted until the update interval of " + repository.getId() + " has elapsed or updates are forced. Original error: " + error, true ); } }
public Exception wrap( ArtifactTransfer transfer, Exception e, RemoteRepository repository ) { ArtifactTransferException ex = null; e = WagonCancelledException.unwrap( e ); if ( e instanceof ResourceDoesNotExistException ) { ex = new ArtifactNotFoundException( transfer.getArtifact(), repository ); } else if ( e != null ) { ex = new ArtifactTransferException( transfer.getArtifact(), repository, e ); } transfer.setException( ex ); return ex; }
@Override public void transferFailed( Exception exception, int classification ) { ArtifactTransferException e; if ( classification == Transporter.ERROR_NOT_FOUND ) { e = new ArtifactNotFoundException( getTransfer().getArtifact(), repository ); } else { e = new ArtifactTransferException( getTransfer().getArtifact(), repository, exception ); } getTransfer().setException( e ); super.transferFailed( e, classification ); }
@Override public void transferFailed( Exception exception, int classification ) { ArtifactTransferException e; if ( classification == Transporter.ERROR_NOT_FOUND ) { e = new ArtifactNotFoundException( getTransfer().getArtifact(), repository ); } else { e = new ArtifactTransferException( getTransfer().getArtifact(), repository, exception ); } getTransfer().setException( e ); super.transferFailed( e, classification ); }
download.setException( new ArtifactTransferException( download.getArtifact(), group.repository, e ) );
download.setException( new ArtifactTransferException( download.getArtifact(), group.repository, e ) );
artEx = new ArtifactTransferException( transfer.getArtifact(), repository, e ); transfer.setException( new ArtifactTransferException( transfer.getArtifact(), repository, t ) ); break; case METADATA: