in src/main/java/org/apache/maven/plugins/gpg/SignAndDeployFileMojo.java [558:591]
protected void deploy(Artifact artifact, ArtifactRepository deploymentRepository) throws ArtifactDeployerException {
final ProjectBuildingRequest buildingRequest = session.getProjectBuildingRequest();
int retryFailedDeploymentCount = Math.max(1, Math.min(10, this.retryFailedDeploymentCount));
ArtifactDeployerException exception = null;
for (int count = 0; count < retryFailedDeploymentCount; count++) {
try {
if (count > 0) {
// CHECKSTYLE_OFF: LineLength
getLog().info("Retrying deployment attempt " + (count + 1) + " of " + retryFailedDeploymentCount);
// CHECKSTYLE_ON: LineLength
}
deployer.deploy(buildingRequest, deploymentRepository, Collections.singletonList(artifact));
for (Object o : artifact.getMetadataList()) {
ArtifactMetadata metadata = (ArtifactMetadata) o;
getLog().info("Metadata[" + metadata.getKey() + "].filename = " + metadata.getRemoteFilename());
}
exception = null;
break;
} catch (ArtifactDeployerException e) {
if (count + 1 < retryFailedDeploymentCount) {
getLog().warn("Encountered issue during deployment: " + e.getLocalizedMessage());
getLog().debug(e);
}
if (exception == null) {
exception = e;
}
}
}
if (exception != null) {
throw exception;
}
}