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
- Check that there are no uncommitted changes in the sources
- Check that there are no SNAPSHOT dependencies
- Change the version in the poms from x-SNAPSHOT to a new version (you will be prompted for the versions to use)
- Transform the SCM information in the POM to include the final destination of the tag
- Run the project tests against the modified POMs to confirm everything is in working order
- Commit the modified POMs
- Tag the code in the SCM with a version name (this will be prompted for)
- Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for)
- Commit the modified POMs
mvn -N release:prepare +OPTIONS
- Perform the release
mvn release:perform -Denv=release
- Checkout from an SCM URL with optional tag
- Run the predefined Maven goals to release the project (by default, deploy site-deploy)
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
- Change dependencies in the POM to be non SNAPSHOT ones
- Change the MANIFEST file to use the last kernel and common versions (the ones which are used in the POM file)
- Commit sources
- Call mvn release:prepare...
- Call mvn release:preform...
- Checkout the petals standalone module just created from the SCM tags
- Call the assembly of standalone
- Do tests...
- 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><server> <id>ebm-maven-repository</id> <username>xxx</username> <password>xxx</password> </server>
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
PDF
History