Skip to content

dsf configure nexus

jodacalc edited this page Jun 11, 2019 · 2 revisions

Nexus Configuration

In this document you will see how you can configure Nexus repository and how to integrate it with jenkins.

Prerequisites

Repositories

You need to have one repository for snapshots, another for releases and another one for release-candidates. Normally you use maven2 (hosted) repositories and if you are going to use a docker registry, you need docker (hosted) too.

To create a repository in Nexus go to the administration clicking on the gear icon at top menu bar. Then on the left menu click on Repositories and press the Create repository button.

nexus create repository

Now you must choose the type of the repository and configure it. This is an example for Snapshot:

nexus create repository form

Create user to upload/download content

Once you have the repositories, you need a user to upload/download content. To do it go to the administration clicking on the gear icon at top menu bar. Then on the left menu click on Users and press the Create local user button.

nexus create user

Now you need to fill a form like this:

nexus create user form

Jenkins integration

To use Nexus in our pipelines you need to configure Jenkins.

Add nexus user credentials

First of all you need to add the user created in the step before to Jenkins. To do it (on the left menu) click on Credentials, then on System. Now you could access to Global credentials (unrestricted).

nexus jenkins credentials

Enter on it and you could see a button on the left to Add credentials. Click on it and fill a form like this:

nexus jenkins credentials form

Add the nexus user to maven global settings

Now you need to go to Manage Jenkins clicking on left menu and enter in Managed files.

jenkins global maven

Edit the Global Maven settings.xml to add your nexus repositories credentials as you could see in the next image:

nexus jenkins global maven form

And you are done.

Clone this wiki locally