HOWTO release

Maven2 release plugin

To release a module, simply follow these steps :

  • Prepare the release
mvn release:prepare -Denv=release -Dscm.username=YOUR_DEV_NAME

It executes the following steps :

  1. Check that there are no uncommitted changes in the sources
  2. Check that there are no SNAPSHOT dependencies
  3. Change the version in the poms from x-SNAPSHOT to a new version (you will be prompted for the versions to use)
  4. Transform the SCM information in the POM to include the final destination of the tag
  5. Run the project tests against the modified POMs to confirm everything is in working order
  6. Commit the modified POMs
  7. Tag the code in the SCM with a version name (this will be prompted for)
  8. Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for)
  9. Commit the modified POMs
If you want to release an artefact and not its children, use the non recursive option :
mvn -N release:prepare +OPTIONS
  • Perform the release
mvn release:perform -Denv=release

It executes the following steps :

  1. Checkout from an SCM URL with optional tag
  2. Run the predefined Maven goals to release the project (by default, deploy site-deploy)
More information on the plugin page.


Note that you MUST release the artefacts in the good order !!!

Beta release options

During a beta release, it can be nice to skip the unit tests which can fail. To do this, add the maven.test.skip option to the release plugin like this :

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-release-plugin</artifactId>
  <version>2.0-beta-4</version>
  <configuration>
    <arguments>-Dmaven.test.skip</arguments>
  </configuration>
</plugin>

Releasing independant modules

PEtALS standalone

  1. Change dependencies in the POM to be non SNAPSHOT ones
  2. Change the MANIFEST file to use the last kernel and common versions (the ones which are used in the POM file)
  3. Commit sources
  4. Call mvn release:prepare...
  5. Call mvn release:preform...
  6. Checkout the petals standalone module just created from the SCM tags
  7. Call the assembly of standalone
  8. Do tests...
  9. Publish ZIP file on the forge

Artefacts deployment in maven repositories

  • PEtALS artefacts are automatically deployed in the corporate repository by the maven release plugin.
  • The release manager MUST also deploy artefacts to the maven2 objectweb repository like this :
    • Change directory to the artefact one
    • Deploy the artefact with CLI (see next chapter)
    • Deploy the source (if required)

Deploy artefacts on repository

Automatic deploy during release process

The artefacts are automatically deployed in the corporate repository during the release process.

Distribution management settings are defined in the POM parent like this :

<distributionManagement>
    <repository>
      <id>ebm-maven-repository</id>
      <name>eBM WebSourcing release repository</name>
      <url>scp://192.168.1.230:/var/lib/m2-repo-petals</url>
    </repository>
    <snapshotRepository>
      <id>ebm-maven-repository</id>
      <name>eBM WebSourcing snapshot repository</name>
      <url>scp://192.168.1.230:/var/lib/m2-repo-snapshots</url>
    </snapshotRepository>
    <site>
      <id>ebm-maven-repository</id>
      <name>eBM WebSourcing PEtALS web site</name>
      <url>scp://192.168.1.230:/var/www/site</url>
    </site>
  </distributionManagement>

To avoid password prompt, you must define the server in the settings.xml file (in your conf directory of the maven installation) :

<server>
  <id>ebm-maven-repository</id>
  <username>xxx</username>
  <password>xxx</password>
</server>

Note : Ask the project manager the login and password.

Deploy an artefact to a maven repository

To deploy an artefact with the deploy plugin :

mvn deploy:deploy-file
  -Durl=scp://HOST:PATH
  -DrepositoryId=REPO_ID
  -DartifactId=ARTEFACT_ID
  -DgroupId=GROUP_ID
  -Dversion=VERSION
  -Dfile=FILE_TO_DEPLOY
  -Dpackaging=POM|JAR

Or if the pom file exists :

mvn deploy:deploy-file
  -Durl=scp://HOST:PATH
  -DrepositoryId=REPO_ID
  -DpomFile=POM_FILE
  -Dfile=FILE_TO_DEPLOY

If you want to deploy the artefact sources, add the classifier options :

mvn deploy:deploy-file
  -Durl=scp://HOST:PATH
  -DrepositoryId=REPO_ID
  -DpomFile=POM_FILE
  -Dfile=SOURCES_TO_DEPLOY
  -Dclassifier=sources