Reputation: 909
I have a Jenkins job which is supposed to build a Jar and add it to Nexus. I have configured post build action to deploy maven artifact to nexus repository.
The problem is, the nexus is expecting username and password. How would i set these in the Jenkins? I do not have access to jenkins settings.xml file. I need to pass username and password in the Jenkins job itself.
Upvotes: 12
Views: 21422
Reputation: 334
The following steps are to upload an artifact from Jenkins to Nexus3 after the building process. This process worked for me and I hope you will find it useful.
${POM_GROUPID}
${POM_VERSION}
${POM_ARTIFACTID}
${POM_PACKAGING}
target/${POM_ARTIFACTID}-${POM_VERSION}.${POM_PACKAGING}
${POM_ARTIFACTID}
pom
pom.xml
Upvotes: 0
Reputation: 589
Take a look at the Config File Provider Plugin. It allows you to provide your own settings.xml for jenkins to use where you can configure all the credentials that you might need.
Upvotes: 4
Reputation: 664
Jenkins and its plugins are using your maven properties. you should provide credentials of nexus repo details in maven settings.xml as mentioned below.
<servers>
<!-- This server.id matches my nexus group -->
<server>
<id>nexus-group</id>
<username>release</username>
<password>****</password>
</server>
Upvotes: 0