Gradle Upload Fails But Still Deploys to Nexus

匿名 (未验证) 提交于 2019-12-03 01:34:02

问题:

Hi my gradle build is failing in the uploadArchives task; but when I check Nexus, the WAR and POM are still deployed to nexus successfully. Can anyone help me understand what's going on.

26-Jul-2016 18:46:28    :compileGroovy UP-TO-DATE 26-Jul-2016 18:46:28    :buildProperties UP-TO-DATE 26-Jul-2016 18:46:28    :processResources UP-TO-DATE 26-Jul-2016 18:46:28    :classes UP-TO-DATE 26-Jul-2016 18:46:28    :compileTestJava UP-TO-DATE 26-Jul-2016 18:46:28    :compileTestGroovy UP-TO-DATE 26-Jul-2016 18:46:28    :compileGsonViews UP-TO-DATE 26-Jul-2016 18:46:36    :war 26-Jul-2016 18:46:44    Could not transfer artifact com.company.software:app-name:war:16.7.26-RELEASE from/to remote (https://www.company.com/nexus/repository/maven-releases/): Failed to transfer file: https://www.company.com/nexus/repository/maven-releases/com/company/software/app-name/16.7.26-RELEASE/app-name-16.7.26-RELEASE.war. Return code is: 400, ReasonPhrase: Repository does not allow updating assets: maven-releases. 26-Jul-2016 18:46:44    Could not transfer artifact com.company.software:app-name:pom:16.7.26-RELEASE from/to remote (https://www.company.com/nexus/repository/maven-releases/): Failed to transfer file: https://www.company.com/nexus/repository/maven-releases/com/company/software/app-name/16.7.26-RELEASE/app-name-16.7.26-RELEASE.pom. Return code is: 400, ReasonPhrase: Repository does not allow updating assets: maven-releases. 26-Jul-2016 18:46:44    :uploadArchives FAILED 26-Jul-2016 18:46:44     26-Jul-2016 18:46:44    FAILURE: Build failed with an exception. 26-Jul-2016 18:46:44     26-Jul-2016 18:46:44    * What went wrong: 26-Jul-2016 18:46:44    Execution failed for task ':uploadArchives'. 26-Jul-2016 18:46:44    > Could not publish configuration 'archives' 26-Jul-2016 18:46:44       > Failed to deploy artifacts: Could not transfer artifact com.company.software:app-name:war:16.7.26-RELEASE from/to remote (https://www.company.com/nexus/repository/maven-releases/): Failed to transfer file: https://www.company.com/nexus/repository/maven-releases/com/company/software/app-name/16.7.26-RELEASE/app-name-16.7.26-RELEASE.war. Return code is: 400, ReasonPhrase: Repository does not allow updating assets: maven-releases. 26-Jul-2016 18:46:44     26-Jul-2016 18:46:44    * Try: 26-Jul-2016 18:46:44    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 26-Jul-2016 18:46:44     26-Jul-2016 18:46:44    BUILD FAILED 26-Jul-2016 18:46:44     26-Jul-2016 18:46:44    Total time: 27.993 secs 

回答1:

I had a similar error pushing a maven release to a hosted release repository:

Error code 400, Repository does not allow updating assets: Releases -> [Help 1] 

To fix it (in nexus 3) I edited the repository and switched the "Deployment policy" value from "Disable redeploy" to "Allow redeploy"

My guess is that it allowed an initial deployment, but then failed to upload newer versions due to the policy.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!