2016-03-12 42 views
1

我试图设置一个Jenkins CI服务器,在完成构建后自动部署到Nexus服务器。我的问题是,由于Nexus存储库受密码保护,并且JAR文件来自第三方(pom.xml文件的存储库未正确设置)。我使用的电流命令如下:Jenkins,Maven,Nexus - 将第三方JAR部署到Nexus需要身份验证的地方

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 

我也不太清楚,如果这是一个问题,但由于最近的法律问题,插口(在我的世界服务器),要求其通过运行“修补”生成的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 

回答

0

原来,因为我张贴,以释放存储库,而不是一个快照存储库的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 

,它似乎是工作。

+1

为了完整性,大多数情况下,当我与释放插件斗争时,这是其中一个原因在这里陈述http://stackoverflow.com/questions/26003271/nexus-accepts-upload-but-says-it-failed/33874539#33874539你也应该接受你的答案! – drgn