Login | Register
My pages Projects Community openCollabNet

argouml
Wiki: Diff for "Setting up Maven"

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

 

Differences between revisions 1 and 9 (spanning 9 versions)

Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
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 {{{
Preparations before it is possible to work with ArgoUML using [http://maven.apache.org/ Maven]:
 * Install Maven.
 * Configure the argouml profile with the two argouml repositories in your {{{settings.xml}}} file. Like this {{{
Line 19: Line 19:
          <name>ArgoUML snapshots</name>
Line 22: Line 21:
            <updatePolicy>daily</updatePolicy>
Line 25: Line 23:
          <releases>
            <enabled>false</enabled>
          </releases>
Line 26: Line 27:
          <layout>default</layout>
Line 30: Line 30:
          <name>ArgoUML released artifacts</name>           <snapshots>
            <enabled>false</enabled>
          </snapshots>
Line 33: Line 35:
            <updatePolicy>daily</updatePolicy>
Line 37: Line 38:
          <layout>default</layout>
Line 40: Line 40:
Line 46: Line 45:
 * 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 tests}}}.
Line 52: Line 48:
== 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 [http://nexus.sonatype.org/oss-repository-hosting.html 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 [http://argouml-jenkins1.no-ip.biz:8080/ Jenkins Continuous Integration server].
 * The Maven Central is the repository that is at the center the Maven world.

== For those new to maven ==
Maven relies heavily on access to repositories throughout the internet. When issueing maven commands, most of the tools and jars are downloaded and stored locally (in the home directory of the user). On subsequent invocations these stored copies are checked for updates and used.

When you type the first mvn command {{{mvn compile}}}, after having installed maven and checked out a part of the argouml project, the following things happens:
 1. the checked out {{{pom.xml}}} file is read. That file references the parentpom or the argouml-core pom.
 1. 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.
 1. The parentpom is downloaded from the ArgoUML Maven2 repository. It is specified from the file or from argouml-core is not a snapshot version.
 1. The parentpom references the sonatype oss-parent pom that is downloaded from the Maven Central.
 1. Then the rest of the maven world is downloaded, with some tool versions specified by the parentpom and some by the [http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Super_POM Super POM (Maven's default pom)].
When you issue your subsequent commands {{{mvn test}}} or {{{mvn site}}} more maven tools are downloaded.

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 next mvn command will download the updated 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.

Preparations before it is possible to work with ArgoUML using Maven:

  • Install Maven.
  • Configure the argouml profile with the two argouml repositories in your settings.xml file. Like this

    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                          http://maven.apache.org/xsd/settings-1.0.0.xsd">
    
      <profiles>
        <profile>
          <id>ArgoUML repositories</id>
          <activation>
            <activeByDefault>true</activeByDefault>
          </activation>
    
          <repositories>
            <repository>
              <id>argouml-snapshots</id>
              <snapshots>
                <enabled>true</enabled>
                <checksumPolicy>fail</checksumPolicy>
              </snapshots>
              <releases>
                <enabled>false</enabled>
              </releases>
              <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            </repository>
            <repository>
              <id>argouml-released</id>
              <snapshots>
                <enabled>false</enabled>
              </snapshots>
              <releases>
                <enabled>true</enabled>
                <checksumPolicy>fail</checksumPolicy>
              </releases>
              <url>http://argouml-downloads.tigris.org/maven2</url>
            </repository>
          </repositories>
        </profile>
      </profiles>
    
    </settings>
    

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.

For those new to maven

Maven relies heavily on access to repositories throughout the internet. When issueing maven commands, most of the tools and jars are downloaded and stored locally (in the home directory of the user). On subsequent invocations these stored copies are checked for updates and used.

When you type the first mvn command mvn compile, after having installed maven and checked out a part of the argouml project, 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 is downloaded from the ArgoUML Maven2 repository. It is specified from the file or from argouml-core is not a snapshot version.
  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.

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 next mvn command will download the updated 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.

Historic

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.

Setting up Maven (last edited 2013-10-18 22:04:07 -0700 by linus)