Maven Repository Managers - why we chose Archiva...and then switched to Nexus

When Archiva 1.0.1 came out, it was a big improvement on the existing Maven repositories - you could actually administer some of the configuration via the web interface, and not via an XML configuration file. How things have changed! Now Nexus would be my recommendation - the open source version to start with, and the professional edition if you start getting serious about your enterprise repository.

I'll leave the original text for it's great value as a historical document :-).

It looks like the Maven folk have updated the Archiva web site home page (http://maven.apache.org/archiva/), possibly to correspond with the recent 1.0.1 release. Nice work, guys, let's hope we see more of it for the other products!

When it came to choosing a Maven repository manager, Archiva was our choice. This article explains why. 

For anyone who doesn't know, Archiva is a Maven repository manager. If you are using Maven in a corporate environment, then you probably need a repository manager. A Maven repository manager acts as both a repository for your JAR files, and a proxy/cache between you and all those dodgy public repositories out there on the internet. So, when Maven asks for a new dependency, its first port of call is your local repository. If the JAR has already been downloaded, it will be stored in the Archiva repository, and you won't need to download it from the internet. This is both faster and more reliable than downloading JAR files directly from the internet.

You can also use a repository/proxy to limit the places developers can download JAR files from. This is useful if you want to make sure people stick to stable builds, and don't use the often-unstable SNAPSHOT builds for their libraries or plugins. Although SNAPSHOT builds may be tempting, they are in fact the bane of a stable build process, and should only be used for experimental purposes. Snapshot plugins? Just say no.

Anyway, so why did we choose Archiva? Archiva is easy to install and use, and has a decent feature set. You can manage user rights, access theHowever, the feature that made us prefer Archiva to the others is its configuration. You can configure Archiva either via an XML configuration file, or through the web interface. This includes adding new network proxies, which means you can add a new network proxy through the web interface without having to restart the server.

Now obviously, Archiva is not the only repository manager around. There are also a few others around. However, none of them met all of our requirements for a repository manager. Here's the run-down:

Artifactory is another Maven repository manager with proxying and caching features. The user interface is appealing. It also has nice Webdav support, and it is easy to import an existing file-based repository into the Artifactory repository. However, you can't configure the server via the web interface - if you want to add a new remote repository, you need to modify a (albeit easy-to-understand) XML configuration file and restart the server.

Proximity is the other major repository manager on the market. It is quite powerful, but I found it a bit complicated to configure: to add a new remote repository, you need to update an XML configuration file and a properties file, and restart the server.

Our choice of a Maven repository manager needed to take into account several factors, including:

  • Can you manage the configuration via the web interface, without restarting the server?
  • Is the user interface easy to understand?
  • Is it easy to use from Maven
  • Can the product host local repositories (we need to be able to store and share internal JARs)
  • Can the product act as a proxy for remote repositories
  • Does the product caches downloaded files?
  • Is it easy to backup and restore the repository automatically?

As it turns out, Archiva is the only product that supports full web-based configuration. I found this a little suprising, since you would think that a repository proxy would benefit from being highly available, and if it has to go down every time you add a new external repository, that might have some impact on availability...

Archiva also supports the other required features in our list. For a production environment, considerations such as modifying the configuration without having to restart the server, and being able to backup the repository as a file system, are particularly important. Automatically  backing up Archiva simply requires backing up the data directory, which contains the cached repositories (stored as an ordinary file structure) and the databases that Archiva uses for its own purposes. Archiva uses two separate databases: one for the users, and one to basically index the repository files. You really need to back up the user database. The other database isn't that critical, since it will be regenerated from scratch if required, Another solution, more appropriate for a production environment, is to set up two external database connections for Archiva's two databases, and then to back up the cached repository file structure separately.

Now for the down side. Any product has its drawbacks, and Archiva is no exception. The user interface is initially slow when the JSP pages compile, but once that is done, it's fast enough. A bit clunky, but fast enough.
Archiva's biggest drawback comes from it's biggest advantage - the web configuration interface is powerful and flexible, but it takes some time to get your head around how it works. Nevertheless, at the end of the day, Archiva does do the job, and does it well.

For more on this subject, Deng Ching, one of the Archiva developers, discusses Archiva and the other repository managers in some detail here

John is a freelance consultant specialising in Enterprise Java, Web Development, and Open Source technologies, currently based in Wellington, New Zealand. Well known in the Java community for his many published articles, John helps organisations to optimize their Java development processes and infrastructures and provides training and mentoring in open source technologies, SDLC tools, and agile development processes. John is principal consultant at Wakaleo Consulting, and runs several Training Courses on open source Java development tools and best practices. John is a DZone MVB and is not an employee of DZone and has posted 68 posts at DZone. You can read more from them at their website.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Rainer Eschen replied on Fri, 2008/02/22 - 6:56pm

We like Archiva, too. We were impressed how it boosts our builds.

Mykel Alvis replied on Sat, 2008/03/08 - 7:52pm

Also note that Proximity has gone bye-bye. Sonatype acquired Tamás to work on Nexus, which will be in Beta for the real world Real Soon Now. Since the svn repo for Proximity disappeared and we have only an old (modified) copy of that, we're apparently going to be forced to switch to Archiva.

Brian Fox replied on Tue, 2008/04/08 - 11:49am

The proximity repository went away due to a disk failure and it's back now. Hopefully that's irrelevant since Nexus has been released and we believe it is far superior. http://nexus.sonatype.org

Mykel Alvis replied on Tue, 2008/04/08 - 3:55pm in response to: brianfox

Excellent news! Although I'd love to switch to Nexus, it's currently impractical to a certain degree thanks to changes that I was forced to make in proximity to make it through our corporate firewall.  I don't know how to get those into Nexus just yet, but when it's possible to build Nexus from source, I should be able to switch.  The changes will be very welcome here. :)

Brian Fox replied on Tue, 2008/04/08 - 5:03pm in response to: mykelalvis

Mykel: Come join us on irc (#nexus on irc.codehaus.org) or the user list (nexus-user-subscribe -at- sonatype.org), I'm interested in these changes you had to make. --Brian

Kostis Anagnost... replied on Tue, 2008/04/22 - 8:59am

Artifactory, as of version 1.2.5 (rel on dec 2007) support dynamic reloading of its configuration file (that is, apply any changes without restarting it).
See http://www.jfrog.org/jira/browse/RTFACT-247

Yoav Aharoni replied on Tue, 2008/11/18 - 4:25pm

beta versions of artifactory 1.3 already support configuring the server via web interface. (supports configuring repositories, services, proxies, ldap, view logs etc...) see http://www.jfrog.org/sites/artifactory/

Brian Fox replied on Thu, 2008/11/20 - 12:09am

Seems like the author now likes Nexus, see his post here: http://weblogs.java.net/blog/johnsmart/archive/2008/04/nexus_my_next_m.html

adesh Yasoda replied on Mon, 2008/12/01 - 2:08pm

Could you suggest best Repository Manager among Nexus, Artifactory & Apache Archia ?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.