Or, How to Release WIthout the Release Plugin
The Process:
- Prepare your branch or trunk for release by bumping your versions.
- Bump the version in your POMs, Java source, etc. I do this with perl and find:
perl -pi -e 's/1.2.0-SNAPSHOT/1.2.0.GA/g' `find . -name \*.xml -or -name \*.java`
- Then commit:
svn commit -m 'Prepare 1.2.0.GA'
- Bump the version in your POMs, Java source, etc. I do this with perl and find:
- Tag your branch or trunk:
svn cp -m 'Tag 1.2.0.GA' http://svn.jboss.org/foo/trunk http://svn.jboss.org/foo/tags/1.2.0.GA
- Do a clean deploy.
mvn clean install
mvn deploy -DaltDeploymentRepository=jboss::default::file:///home/david/src/java/repos-maven2
- Commit your new artifacts to the repository.
cd /home/david/src/java/repos-maven2/org/jboss/groupId
svn status
andsvn diff
, verify everything is correctsvn commit -m 'Release Foo 1.2.0.GA'
- Return to your branch or trunk, and bump your versions for the next version.
- Perl and find:
perl -pi -e 's/1.2.0.GA/1.3.0-SNAPSHOT/g' `find . -name \*.xml -or -name \*.java`
- Then commit:
svn commit -m 'Next is 1.3.0'
- Perl and find:
- Done. The whole thing takes me 3 minutes.
The Details:
- Before you can use this process, you need to have the repository (at least partially) checked out. I do this with a non-recursive checkout:
svn co -N https://svn.jboss.org/repos/repository.jboss.org/maven2 repos-maven2
cd repos-maven2
svn up -N org && cd org
svn up -N jboss && cd jboss
svn up foo
(pull in the whole org.jboss.foo subtree)
- I also have a shell script which replaces
mvn deploy -DaltDeploymentRepository=jboss::default::file:///home/david/src/java/repos-maven2
with a shorter commandmvn-deploy
. - To prevent your aggregator module from publishing an artifact to the repository, add the following snippet (credit to Pete Muir):
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin>
Comments