我有一个maven构建和artifactory(现在非常不稳定),所以有时会返回'Failed to respond'错误。我增加了'retryFailedDeploymentCount'参数,但仍有问题。我的构建日志中的代码段如下:
[INFO] Uploading: https://my-artifactory.com/artifactory/.../my/groupid/artifactId/1.0.0-beta/artifactId-1.0.0-beta.jar
[INFO] Uploading: https://my-artifactory.com/artifactory/.../my/groupid/artifactId/1.0.0-beta/artifactId-1.0.0-beta.pom
[INFO] Uploaded: https://my-artifactory.com/artifactory/.../my/groupid/artifactId/1.0.0-beta/artifactId-1.0.0-beta.pom (2 KB at 0.4 KB/sec) !!!SUCCESS!!!
[WARNING] Encountered issue during deployment: Failed to deploy artifacts: Could not transfer artifact my.groupid:artifact:jar:1.0.0-beta from/to central (https://my-artifactory.com/artifactory/.../): my-artifactory.com:443 failed to respond
[INFO] Retrying deployment attempt 2 of 10
[INFO] Uploading: https://my-artifactory.com/artifactory/.../my/groupid//artifact/1.0.0-beta/artifactId-1.0.0-beta.jar
[INFO] Uploaded: https://my-artifactory.com/artifactory/.../my/groupid//artifact/1.0.0-beta/artifactId-1.0.0-beta.jar (32 KB at 15.6 KB/sec) !!!SUCCESS!!!
[INFO] Uploading: https://my-artifactory.com/artifactory/.../my/groupid//artifact/1.0.0-beta/artifactId-1.0.0-beta.pom
[WARNING] Encountered issue during deployment: Failed to deploy artifacts: Could not transfer artifact my.groupid:artifact:pom:1.0.0-beta from/to central (https://my-artifactory.com/artifactory/.../): Access denied to: https://my-artifactory.com/artifactory/.../my/groupid/artifactId/1.0.0-beta/artifactId-1.0.0-beta.pom, ReasonPhrase: Forbidden.
[INFO] Retrying deployment attempt 3 of 10
[INFO] Uploading: https://my-artifactory.com/artifactory/.../my/groupid//artifact/1.0.0-beta/artifactId-1.0.0-beta.jar
[INFO] Uploading: https://my-artifactory.com/artifactory/.../my/groupid//artifact/1.0.0-beta/artifactId-1.0.0-beta.pom
[WARNING] Encountered issue during deployment: Failed to deploy artifacts: Could not transfer artifact my.groupid:artifact:jar:1.0.0-beta from/to central (https://my-artifactory.com/artifactory/.../): Access denied to: https://my-artifactory.com/artifactory/.../my/groupid/artifactId/1.0.0-beta/artifactId-1.0.0-beta.jar, ReasonPhrase: Forbidden.
[INFO] Retrying deployment attempt 4 of 10
所以在第一次尝试maven-deploy-plugin部署了pom,但是没有使用jar。在第二次尝试部署了jar,但是pom失败了(因为它已经部署了,我没有权利更新以前部署的工件)。由于第二次尝试没有完全成功,它进入第三次尝试,现在无法部署任何一个(pom和jar),因为它们已经部署,然后第四次尝试,第五次,所以一次到极限。
所以我处于部署成功的情况,但maven构建失败,因为我的所有10次尝试均未成功。
如何强制maven跟踪先前尝试部署的工件并且不再重新部署?什么是适当的解决方案?
我正在使用maven 3.3.9,maven-deploy-plugin 2.8.1和java 1.7.0_144。