I am trying to use maven release plugin to cut releases, I really like maven’s dependency management, and here’s trying to use maven to manage releases. Special thanks to John and Nick.

It’s really just 3 steps :

  1. mvn release:prepare -DdryRun=true
  2. mvn release:clean release:prepare
  3. mvn release:perform

But here are some things I learnt though…

  1. Upon release:prepare errors, use release:rollback before release:clean (wipe out all the pom.* release.properties that’s needed for release plugin)
  2. Undoing subversion changes using  svn merge -r 999:998 http://subversion/project/dir to revert back to the last working version. This is because release:prepare errors might have occurred after copy checked into subversion.

And finally, some pre-requisites :

Working copy must be SNAPSHOT

Dependencies must NOT be SNAPSHOT – to overcome this I had to  download and install a ‘special version’ into your own (local) maven repository :

mvn:deploy

will deploy to my scm definition in my pom.xml

<scm>
<connection>scm:svn:http://subversion/project/dir</connection&gt;
<developerConnection>scm:svn:http://subversion/project/dir</developerConnection&gt;
<url>http://subversion/project/dir</url&gt;
</scm>

and reference to it in your repository

<repository>
<id>vocanic-m2</id>
<url>http://subversion/m2/</url&gt;
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>

Mac OS subversion 1.4.4 – use this version because on Leopard, subversion 1.5.1 has a problem and somehow can’t create tags on subversion causing the release:prepare to check in the release copy but cannot move/create a tag copy – that’s where I learn (2) above – see here also

Advertisements