Installing Nexus on Ubuntu 11.10 and Tomcat 6 Part 2

Posted by: TomS on April 15, 2012 @ 8:58 pm

NexusIn Part 1 of this post, I covered performing a basic installation of Nexus in a Tomcat servlet container on Ubuntu 11.10.  Now I’m going to cover the details of configuring Nexus.

Nexus is a repository that can be used with tools such as Maven to index and store artifacts for dependency management across projects.  I like to use the Nexus/Maven combo for three main reasons:

  1. Storing Versions of My Own Artifacts – I try to do all my Java builds in Maven these days.  This means that all my projects always have a standard lifecycle and release procedures.  I can commit my code to SVN, but its also nice to have a repository to store my compiled artifacts.  Nexus fills this job, allowing me to deploy all versioned projects to the central repository, accessible from all of my machines.  Additionally, the repository makes all these versioned artifacts available as dependencies for any of the other projects I work with.
  2. Proxying Other Repositories – When you work with Java Maven projects, you’ll get pretty used to Maven “downloading the internet” the first time you build a particular project on a machine.  This is Maven getting all the dependencies and transitive dependencies required to build your project.  It might take a little while, but its far better than trying to manage all those dependencies yourself.  This step is often dependent on external repositories outside of my control, however.  The external repositories may gone down (but rarely), and it is common for these repositories to eventually remove old versions of artifacts or reorganize their repositories.   Proxying a repository means that my Maven builds will always fetch artifacts from my Nexus repository first.  If Nexus can’t find the artifact, it will download it from the external repository, but it will store it locally so future requests do not depend on the external repository.  This means that the artifacts I use never go away, and the process is much faster since I only need to retrieve artifacts from my own repository in most cases.
  3. Hosting 3rd Party Artifacts – There are times when I use a jar, but the jar isn’t readily available in a Maven repository somewhere.  I try to avoid just adding those jars to SVN.  Instead, I’ll upload the artifacts to Nexus and I can access them as needed via standard Maven builds.


Installing Nexus on Ubuntu 11.10 and Tomcat 6 Part 1

Posted by: TomS on April 10, 2012 @ 7:37 am

I’ve used Maven and Nexus at work quite extensively, and since I’ve become familiar with the tooling, I’ll never go back.  When using a mature language like Java that has an expansive ecosystem, dependency management is a must.  Maven has its rough edges, but it does get the job done, and I’ve always been pleasantly surprised with how easy it is to use Nexus and how little maintenance it really requires.

I’m planning on doing a bit more Java development at home, and I’d like to have my own Nexus repository hosted on my internal network.  Part 2 of this article will cover configuring Nexus and the benefits of using it.  In this part of the article, I’ll walk through the steps for setting up and configuring Nexus from a base Ubuntu 11.10 Server installation.

For my purposes, I would like the end result of my installation to be that I can go to (a DNS name on my internal network) and be able to interact with Nexus, so I’ll be doing some additional configuration with Apache Web Server to make this happen.