Subversion and Maven

Maven and subversion both manage different versions of development projects but they have different focusses. While Maven focusses on the management of whole modules/projects/packages, subversion manages each and every file of the development.

In Maven, the version that is currently under development is annotated with the version postfix „-SNAPSHOT“. In subversion, the current development version is usually found in the folder „trunk“ (see discussion of subversion and directory structure).

The basic setup to use maven and subversion is to have a -SNAPSHOT project in Maven and a corresponding trunk folder in subversion.

A more sophisticated setup involves managing releases. Maven can be configured to create a new folder in Subversion‘s „tags“ directory for every release version in maven (that is versions, which do not end on „-SNAPSHOT“). Below are some tutorials, which describe the process.

It is also rather easy to create these tags versions with the IDE. In eclipse, for instance, just right click the project and select Team / Tag … to create a new tagged folder for a release. A bit of manual work but you have a clear track of what is happing.

When using an IDE, I would recommend to use the built-in subversion functionality (or the subversion plugins in case of eclipse), for the every day development, and the Maven plugin to explicitly handle releases.

Resources

Tutorial showing how to setup subversion to use with Maven
Tutorial showing how the maven release plugin is used
A simple example using Maven and Subversion
Documentation of maven-release plugin
Adding Cruise Control to an Maven/SVN environment for Continuous Integration
Reuse subversion build number for Maven build

One thought on “Subversion and Maven

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s