SVN – Using Subversion as an Artifact Repository vs Specific Artifact Management Tools

dependency-managementsvn

TL;DR: Why use something like Apache Archiva or Sonatype Nexus as an artifact repository instead of Subversion?

The build system I use currently has a lot of binary blobs (images, sound files, compiled binaries, etc), both as input and output to our builds. Our system for managing these is very ad hoc; some are checked into our Subversion repository alongside our code, some are stored elsewhere outside any formal version control.

I'm looking at consolidating this, so we have something that's more self-consistent and easy to use, and which separates binary artifacts from code.

Google tells me there are a selection of artifact repositories available (Archiva, Nexus, Artifactory, …), but from reading around, I can't see any advantage to using these over Subversion. That will look after the binaries for us – it already does that for some of our binaries, we'd just want to rearrange the repository layout to separate them from code – and has the notable advantage that we already have Subversion servers and expertise.

So. What's the advantage of using a dedicated artifact management system over using a general version control tool like Subversion?

Best Answer

Short answer: Generally, you don't need a history of binary artifacts and changes to those artifacts, you just need specific versions.

Longer answer: Every time you commit a small change to a binary file, version control systems don't have any way to create a delta -- a diff between the two files -- so it creates a whole new copy.

In a CVCS, like SVN, that's not such a big pain, because you only have one central copy of your repository -- your local copy is only one version. (Although, even then, your repository can become very large, making checkins slower.) But what happens if you later switch to a DVCS, where every copy of a repository has the full history of every file? The size of changes becomes very relevant there.

And what does it give you in return for the pain? The only thing it offers is being able to go back to a previous version of your repository and know that you have the correct binaries for that version.

But do you need the whole binary in your repository to do that? Or can you get away with simply having a text file, telling the build process which versions to pull from another repository elsewhere?

The latter is what is offered by artifact repositories generally.

In addition, some of the more professional ones, such as Nexus, will also give you information about licensing for third-party artifacts, so that you don't risk falling afoul of some subtle clause in what you believe to be a FOSS library.