/** * Creates a new exception with the specified artifact, repository and cause. * * @param artifact The untransferable artifact, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public ArtifactTransferException( Artifact artifact, RemoteRepository repository, Throwable cause ) { this( artifact, repository, "Could not transfer artifact " + artifact + getString( " from/to ", repository ) + getMessage( ": ", cause ), cause ); }
/** * Creates a new exception with the specified artifact, repository and cause. * * @param artifact The untransferable artifact, may be {@code null}. * @param repository The involved remote repository, may be {@code null}. * @param cause The exception that caused this one, may be {@code null}. */ public ArtifactTransferException( Artifact artifact, RemoteRepository repository, Throwable cause ) { this( artifact, repository, "Could not transfer artifact " + artifact + getString( " from/to ", repository ) + getMessage( ": ", cause ), cause ); }
public void testArtifactUpload() throws Exception { addExpectation("gid/aid/version/aid-version-classifier.extension", "artifact"); addExpectation("gid/aid/version/aid-version-classifier.extension.sha1", sha1("artifact")); addExpectation("gid/aid/version/aid-version-classifier.extension.md5", md5("artifact")); Artifact artifact = artifact("artifact"); ArtifactUpload up = new ArtifactUpload(artifact, artifact.getFile()); List<ArtifactUpload> uploads = Arrays.asList(up); connector().put(uploads, null); ArtifactTransferException ex = up.getException(); assertNull(ex != null ? ex.getMessage() : "", ex); assertExpectations(); }
public void IGNOREtestArtifactWithZeroBytesFile() throws Exception { String content = ""; addExpectation("gid/aid/version/aid-version-classifier.extension", content); addExpectation("gid/aid/version/aid-version-classifier.extension.sha1", sha1(content)); addExpectation("gid/aid/version/aid-version-classifier.extension.md5", md5(content)); Artifact artifact = artifact(content); ArtifactUpload up = new ArtifactUpload(artifact, artifact.getFile()); List<ArtifactUpload> uploads = Arrays.asList(up); connector().put(uploads, null); ArtifactTransferException ex = up.getException(); assertNull(ex != null ? ex.getMessage() : "", ex); assertExpectations(); }
throw new DeploymentException( "Failed to deploy artifacts: " + upload.getException().getMessage(), upload.getException() );
throw new DeploymentException( "Failed to deploy artifacts: " + upload.getException().getMessage(), upload.getException() );