Jenkins, Maven, Nexus - Deploy 3rd Party JAR to Nexus Where Authentication is Needed

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] ------------------------------------------------------------------------
[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


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.

Need Your Help

How can I make a pretty URL but still get data with PHP

php url get

I'm trying to make a dynamic page which will show the content based on the URL but I'm wondering if it's possible to make the URL more readable for the user.