1

I'm trying to set up a Jenkins CI server to automatically deploy to a Nexus server after it finishes building. My issue is that since the Nexus repository is both password protected and the fact that the JAR file is from a third party (the pom.xml file's repository is not set up correctly). The current command I am using is as follows:

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

I'm also not too sure if this is an issue, but due to recent legal issues, Spigot (the Minecraft server) requires that it be run through a "BuildTools" application that "patches" the resulting JAR file, so I can't directly clone from a git repository.

I'm a bit stumped at this point, so I'd appreciate any help you can give me. Thank you!

EDIT: I forgot to include the error I get:

[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
mattrick
  • 3,580
  • 6
  • 27
  • 43

1 Answers1

0

Turns out that since I was posting to a release repository rather than a snapshot repository, Nexus was rejecting the build:

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

I simply changed the command to:

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

And it appears to be working.

mattrick
  • 3,580
  • 6
  • 27
  • 43
  • 1
    For completeness, Most of the time when i struggle with the release plugin it is one of those reason stated here http://stackoverflow.com/questions/26003271/nexus-accepts-upload-but-says-it-failed/33874539#33874539 Also you should accept your answer ! – drgn Mar 14 '16 at 17:13