【问题标题】:Jenkins, Maven, Nexus - Deploy 3rd Party JAR to Nexus Where Authentication is NeededJenkins、Maven、Nexus - 将第 3 方 JAR 部署到需要身份验证的 Nexus
【发布时间】:2016-06-28 01:54:20
【问题描述】:

我正在尝试设置 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 服务器)要求它通过“修补”生成的 JAR 文件的“BuildTools”应用程序运行,所以我无法直接从 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

【问题讨论】:

    标签: java git maven jenkins nexus


    【解决方案1】:

    事实证明,由于我发布到发布存储库而不是快照存储库,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
    

    而且它似乎正在工作。

    【讨论】:

    猜你喜欢
    • 2012-05-19
    • 1970-01-01
    • 1970-01-01
    • 2013-03-06
    • 2017-04-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-29
    相关资源
    最近更新 更多