DevOps Tutorial (Part 3): Artifact Management

DevOps Tutorial - Featured Image

DevOps Tutorial

This DevOps Tutorial is Part 3 of my series on Java Project Versioning. Check out the other articles:

Now that your build pipeline consistently versions your Maven project, you need a place to store your artifacts which are being produced at the end of this pipeline.  These artifacts need to be stored much the same way your source code is stored in your SCM.  This ensures access to previously released versions of your product.  An Artifact Repository is designed to store your war/jar/ear/etc, and distribute it to fellow developers via Maven, Ivy, or the like, share your artifact with you deployment tools, and generally ensure an immutable history of your released products.  An Artifact Repository has many more uses beyond storing the released war files for you project, but that is beyond the scope of this article.  For more information on artifact repositories Sonatype, the makers of Nexus, have a nice introduction here (http://blog.sonatype.com/2009/04/what-is-a-repository/#.VTfSdPnF8Ro)

First we need to install an Artifact Repository, my choice for this is Sonatype Nexus.  I have written a tutorial on how to install and configure Sonatype Nexus on CentOS 7, or you can follow the Sonatype instructions on their website.

It’s time to change our pom.xml yet again.  The distributionManagement section of the pom needs to be updated and pointed to our Nexus server.

DevOps Tutorial - ArtifactManagment1

Add the credentials of a user which has deploy permissions on the Nexus server.  Modify your $MAVEN_HOME/conf/settings.xml file and add the following within the servers tag.  I have used the default Nexus username/password for the deployment user.

DevOps Tutorial - ArtifactManagment2

Now we can perform a release of our war, and it will be stored in Nexus’s release repository.  This will allow other developers and system administrators’ access to the war to use as a dependency, or to deploy to a production server.

mvn release:prepare release:perform

In order to download the new artifact “SampleWebApp123-3.01.war” open a browser and go to http://quartz:8081/nexus

DevOps Tutorial

 

Select “Repositories” in the left menu

DevOps Tutorial

 

You can now download any release you have made.

In the next article in this DevOps Tutorial series we will explore how to wrap this entire process up in a Continuous Integration (CI) server.

The following two tabs change content below.

Scott Rich

A strong entrepreneurial technical leader with experience in software development, system design, business management, and technical sales. My career has focused on Software as a Service (SaaS) systems, maintainable systems for high availability, and customer focused user experiences (UI/UX). I have successfully founded and sold two companies. I have had my work presented at numerous conferences including speaking at the Minnesota ITS Conference where I spoke about my emergency deployment of custom traffic monitoring solutions only hours after the I-35W bridge collapse.

Latest posts by Scott Rich (see all)

Authors

Related posts

*

Top