Jenkins、Maven、Nexus - 将第 3 方 JAR 部署到需要身份验证的 Nexus
Jenkins, Maven, Nexus - Deploy 3rd Party JAR to Nexus Where Authentication is Needed
我正在尝试设置 Jenkins CI 服务器以在完成构建后自动部署到 Nexus 服务器。我的问题是,由于 Nexus 存储库受密码保护,而且 JAR 文件来自第三方(pom.xml 文件的存储库设置不正确)。我当前使用的命令如下:
mvn deploy:deploy-file -Dpackaging=jar -DrepositoryId=nexus -Durl=http://nexus.<redacted>.com/content/repositories/releases -DpomFile=Spigot/Spigot-Server/pom.xml -Dfile=Spigot/Spigot-Server/target/spigot-1.9-R0.1-SNAPSHOT.jar
我也不太确定这是否是个问题,但由于最近的法律问题,Spigot(Minecraft 服务器)要求 运行 通过 "BuildTools" 应用程序 "patches" 生成的 JAR 文件,所以我不能直接从 git 存储库克隆。
在这一点上我有点难过,所以如果你能给我任何帮助,我将不胜感激。谢谢!
编辑:我忘记包含我得到的错误:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error deploying artifact: Failed to transfer file: http://nexus.<redacted>.com/content/repositories/releases/org/spigotmc/spigot/1.9-R0.1-SNAPSHOT/spigot-1.9-R0.1-20160312.214547-1.jar. Return code is: 400
事实证明,由于我发布到发布存储库而不是快照存储库,Nexus 拒绝构建:
Storing of item releases:/org/spigotmc/spigot/1.9-R0.1-SNAPSHOT/spigot-1.9-R0.1-20160312.214547-1.jar is forbidden by Maven Repository policy. Because releases is a RELEASE repository
我只是将命令更改为:
mvn deploy:deploy-file -Dpackaging=jar -DrepositoryId=nexus -Durl=http://nexus.<redacted>.com/content/repositories/snapshots -DpomFile=Spigot/Spigot-Server/pom.xml -Dfile=Spigot/Spigot-Server/target/spigot-1.9-R0.1-SNAPSHOT.jar
它似乎在工作。
我正在尝试设置 Jenkins CI 服务器以在完成构建后自动部署到 Nexus 服务器。我的问题是,由于 Nexus 存储库受密码保护,而且 JAR 文件来自第三方(pom.xml 文件的存储库设置不正确)。我当前使用的命令如下:
mvn deploy:deploy-file -Dpackaging=jar -DrepositoryId=nexus -Durl=http://nexus.<redacted>.com/content/repositories/releases -DpomFile=Spigot/Spigot-Server/pom.xml -Dfile=Spigot/Spigot-Server/target/spigot-1.9-R0.1-SNAPSHOT.jar
我也不太确定这是否是个问题,但由于最近的法律问题,Spigot(Minecraft 服务器)要求 运行 通过 "BuildTools" 应用程序 "patches" 生成的 JAR 文件,所以我不能直接从 git 存储库克隆。
在这一点上我有点难过,所以如果你能给我任何帮助,我将不胜感激。谢谢!
编辑:我忘记包含我得到的错误:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error deploying artifact: Failed to transfer file: http://nexus.<redacted>.com/content/repositories/releases/org/spigotmc/spigot/1.9-R0.1-SNAPSHOT/spigot-1.9-R0.1-20160312.214547-1.jar. Return code is: 400
事实证明,由于我发布到发布存储库而不是快照存储库,Nexus 拒绝构建:
Storing of item releases:/org/spigotmc/spigot/1.9-R0.1-SNAPSHOT/spigot-1.9-R0.1-20160312.214547-1.jar is forbidden by Maven Repository policy. Because releases is a RELEASE repository
我只是将命令更改为:
mvn deploy:deploy-file -Dpackaging=jar -DrepositoryId=nexus -Durl=http://nexus.<redacted>.com/content/repositories/snapshots -DpomFile=Spigot/Spigot-Server/pom.xml -Dfile=Spigot/Spigot-Server/target/spigot-1.9-R0.1-SNAPSHOT.jar
它似乎在工作。