Login | Register
My pages Projects Community openCollabNet

Wiki: Setting up Maven

Revision 7 as of 2011-09-13 19:20:43 -0700

Edit this page | Links to this page | Page information | Attachments | Refresh page


To compile with Maven (this is probably more of a vision than it is working):

  • Make sure you have Maven installed.
  • Configure the two argouml repositories in your settings.xml file. Like this

    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          <id>ArgoUML repositories</id>
  • Check out the part of argouml you want to work with from subversion: svn co http://argouml.tigris.org/svn/argouml/trunk/src/argouml-core-notation.

  • Compile with maven mvn compile.

  • Run tests with maven mvn test.

If you would want to work from within Eclipse, you should know that there is a conflict between the .project and .classpath files currently in the repository and the pom.xml file that controls all dependencies when running maven. Until a decision is made to move entirely to maven, you will have to avoid checking in the changes to the .project and .classpath files that are caused by Eclipse recalculating the dependencies based on the contents of the pom.xml file.

How the system is set up and works

The Continuous Integration server builds snapshots when a developer commits to the repository. If the build is successful a snapshot is uploaded automatically to the Sonatype OSS Repository Hosting. These have version number like 0.2-SNAPSHOT.

All core projects have the same version number, specified in the argouml-core pom (at trunk/pom.xml) and referring to the same version number. Non-core projects, such as argouml-actionscript3, must specify the version number of the used argouml core jars explicitly.

All projects, core argouml projects and non-core projects alike, use the parentpom (at trunk/tools/maven/parentpom.xml) to define the version and configuration of tools used to compile, run unit, and static tests throughout the entire argouml project. It also defines the directory layout.

For the build to work, there are two argouml-specific repositories used. There is also the Maven infrastructure repositories:

  • The ArgoUML Maven2 repository at http://argouml-downloads.tigris.org/maven2. This is used for non-snapshot files such as parentpom, the tools jar, and libraries used. This is the same repository where released argouml artifacts are stored and the libraries used are the ones that are part of the release and used by java web start.

  • The OSS Sonatype Snapshot repository at https://oss.sonatype.org/content/repositories/snapshots/ that is provided to the ArgoUML project by Sonatype. Linus Tolke is the only developer that has access to upload snapshots and that is done from the Jenkins Continuous Integration server.

  • The Maven Central is the repository that is at the center the Maven world.

When you type the first mvn command mvn compile the following things happens:

  1. the checked out pom.xml file is read. That file references the parentpom or the argouml-core pom.

  2. If it references the argouml-core pom it is a snapshot version and the specified argouml-core pom is downloaded from the OSS Sonatype Snapshot repository.
  3. The parentpom specified from the file or from argouml-core is not a snapshot version. It is downloaded from the ArgoUML Maven2 repository.
  4. The parentpom references the sonatype oss-parent pom that is downloaded from the Maven Central.
  5. Then the rest of the maven world is downloaded, with some tool versions specified by the parentpom and some by the Super POM (Maven's default pom).

When you issue your subsequent commands mvn test or mvn site more maven tools are downloaded. Maven stores these files on your machine so they will only be downloaded once.

When a new version is released all snapshot versions will be updated to the next version number, also the pom.xml in the project you have checked out. After you have gotten an update of the pom.xml of the project you are working with, the following mvn command will download the next version of all snapshot files.

If the parentpom or tools is updated to a newer version, the new version needs to be put into the ArgoUML Maven2 repository.


During 2011 the first experiments with Maven were done. This was first done to improve the tool set-up in the continuous integration server and later as a possibility to improve the build environment for any user.