Nexus is a repository manager. It allows you to proxy, collect, and manage your dependencies so that you are not constantly juggling a collection of JARs. It makes it easy to distribute your software. Internally, you configure your build to publish artifacts to Nexus and they then become available to other developers. You get the benefits of having your own 'central', and there is no easier way to collaborate.
In this article we will see how we can integrate Nexus repository manager with Jenkins and see how we can upload a package from Jenkins build to the nexus repository manager.
- Download the nexus plugin from here.
- Upload the nexus plugin into our Jenkins Server using Plugin Manager. From Jenkins Dashboard, Navigate to Manage Jenkins -> Plugin Manager. Proceed to the advanced tab, upload the hpi file using the Upload plugin.
- Once the plugin is installed we will be seeing Nexus Configuration options in the Manage Jenkins -> Configure System. Configure the Sonatype nexus with details
Fill the details like where the Server is running and also configure a credentials with user name and password for logging into the Nexus Manager. The credentials should be the same for logging in to the nexus repository manager. The default credentials for the nexus repository manager are “admin” and “admin”. Test the Connection to the server and if success, we have successfully created the integration between Jenkins and Nexus
4. Configure the job to upload a package to the nexus repository. Choose the Add Post Build -> Nexus repository manager. We can see a publisher window added to the job like below. Some of the details will be available like Nexus Instance ( the same name that we have given in the nexus configuration in the above ), It will show us the nexus repositories available to upload our packages.
In the Package section, fill the necessary details like group , artifact , version etc based on your application. We also need to choose the File path from where we need to take the package and upload that to the Nexus repo manager.
This is how we will be configuring the Nexus repository manager with Jenkins.
No comments :
Post a Comment