Harshal Vaidya Harshal Vaidya - 9 days ago 6
Java Question

Upload Jenkins build file .war to Nexus Repository remotely

I have Jenkins setup with Maven as a build tool. Java project is pulled from SVN and it is built using Maven (all inside Jenkins). Once the project is built I get

project.war
package file which I need to be uploaded to Nexus Repository.

Whats the simplest way to do that?

I tried tweaking/modifying my existing
settings.xml
and
pom.xml
, but no luck. Nothing is happening.

I want the
.war
file to be uploaded to Nexus Repository which I configured on other box.

Answer

You can use the Nexus Maven Plugin for your purpose. And in your Jenkins script, just run:

mvn clean deploy

As it is described in the documentation.

Comments