Jenkins 到 Nexus - 部署工件时出错:无法传输文件 400
Jenkins to nexus - Error deploying artifact: Failed to transfer file 400
出于某种原因,我们早些时候在 nexus 上启用了覆盖版本。哪能乱。
Sonatype Nexus™ 2.3.1-01
executable-war /home/jenkins/jenkins-1.555.war
所以现在我们禁用了它,因此无法覆盖发布。但是它似乎以某种方式失败了。我没有覆盖任何文件,但我现在仍然得到以下信息。与覆盖文件相同的错误:
[INFO] [war:war {execution: default-war}]
[INFO] Packaging webapp
[INFO] Assembling webapp [PROJ] in [/var/lib/jenkins/workspace/PROJ/target/PROJ-1.1.0]
[INFO] Processing war project
[INFO] Copying webapp resources [/var/lib/jenkins/workspace/PROJ/src/main/webapp]
[INFO] Webapp assembled in [153 msecs]
[INFO] Building war: /var/lib/jenkins/workspace/PROJ/target/PROJ-1.1.0.war
[INFO] [install:install {execution: default-install}]
[INFO] Installing /var/lib/jenkins/workspace/PROJ/target/PROJ-1.1.0.war to /home/jenkins/.m2/repository/com/norsktipping/PROJ/1.1.0/PROJ-1.1.0.war
[INFO] [deploy:deploy {execution: default-deploy}]
Uploading: http://url:8081/nexus/content/repositories/releases/com/norsktipping/PROJ/1.1.0/PROJ-1.1.0.war
25890K uploaded (PROJ-1.1.0.war)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error deploying artifact: Failed to transfer file: http://url:8081/nexus/content/repositories/releases/com/company/PROJ/1.1.0/PROJ-1.1.0.war.md5. Return code is: 400
[INFO] ----------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] -----------------------------------------------------------------------
[INFO] Total time: 17 seconds
[INFO] Finished at: Wed Oct 28 16:39:44 CET 2015
[INFO] Final Memory: 48M/406M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /var/lib/jenkins/workspace/PROJ/pom.xml to com.company/PROJ/1.1.0/PROJ-1.1.0.pom
[JENKINS] Archiving /var/lib/jenkins/workspace/PROJ/target/PROJ-1.1.0.war to com.company/PROJ/1.1.0/PROJ-1.1.0.war
见bosvos' answer to Error when deploying an artifact in Nexus:
In the rare event that you need to redeploy the SAME STABLE artifact to Nexus, it will fail by default. If you then delete the artifact from Nexus (via the web interface) for the purpose of deploying it again, the deploy will still fail, since just removing the e.g. jar or pom does not clear other files still laying around in the directory. You need to log onto the box and delete the directory in its entirety.
出于某种原因,我们早些时候在 nexus 上启用了覆盖版本。哪能乱。
Sonatype Nexus™ 2.3.1-01
executable-war /home/jenkins/jenkins-1.555.war
所以现在我们禁用了它,因此无法覆盖发布。但是它似乎以某种方式失败了。我没有覆盖任何文件,但我现在仍然得到以下信息。与覆盖文件相同的错误:
[INFO] [war:war {execution: default-war}]
[INFO] Packaging webapp
[INFO] Assembling webapp [PROJ] in [/var/lib/jenkins/workspace/PROJ/target/PROJ-1.1.0]
[INFO] Processing war project
[INFO] Copying webapp resources [/var/lib/jenkins/workspace/PROJ/src/main/webapp]
[INFO] Webapp assembled in [153 msecs]
[INFO] Building war: /var/lib/jenkins/workspace/PROJ/target/PROJ-1.1.0.war
[INFO] [install:install {execution: default-install}]
[INFO] Installing /var/lib/jenkins/workspace/PROJ/target/PROJ-1.1.0.war to /home/jenkins/.m2/repository/com/norsktipping/PROJ/1.1.0/PROJ-1.1.0.war
[INFO] [deploy:deploy {execution: default-deploy}] Uploading: http://url:8081/nexus/content/repositories/releases/com/norsktipping/PROJ/1.1.0/PROJ-1.1.0.war 25890K uploaded (PROJ-1.1.0.war)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error deploying artifact: Failed to transfer file: http://url:8081/nexus/content/repositories/releases/com/company/PROJ/1.1.0/PROJ-1.1.0.war.md5. Return code is: 400
[INFO] ----------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] -----------------------------------------------------------------------
[INFO] Total time: 17 seconds
[INFO] Finished at: Wed Oct 28 16:39:44 CET 2015
[INFO] Final Memory: 48M/406M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /var/lib/jenkins/workspace/PROJ/pom.xml to com.company/PROJ/1.1.0/PROJ-1.1.0.pom
[JENKINS] Archiving /var/lib/jenkins/workspace/PROJ/target/PROJ-1.1.0.war to com.company/PROJ/1.1.0/PROJ-1.1.0.war
见bosvos' answer to Error when deploying an artifact in Nexus:
In the rare event that you need to redeploy the SAME STABLE artifact to Nexus, it will fail by default. If you then delete the artifact from Nexus (via the web interface) for the purpose of deploying it again, the deploy will still fail, since just removing the e.g. jar or pom does not clear other files still laying around in the directory. You need to log onto the box and delete the directory in its entirety.