in src/main/java/org/apache/maven/plugins/gpg/SignAndDeployFileMojo.java [496:526]
protected void deploy(RemoteRepository deploymentRepository, List<Artifact> artifacts) throws DeploymentException {
int retryFailedDeploymentCount = Math.max(1, Math.min(10, this.retryFailedDeploymentCount));
DeploymentException 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
}
DeployRequest deployRequest = new DeployRequest();
deployRequest.setRepository(deploymentRepository);
deployRequest.setArtifacts(artifacts);
repositorySystem.deploy(session.getRepositorySession(), deployRequest);
exception = null;
break;
} catch (DeploymentException 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;
}
}