I'm developing several mavenised projects on my laptop, and periodically pushing to github. I've set up a private hudson server in the cloud that polls the git repositories for updates, and thus performs builds - so far so good.
Unfortunately, when I execute a 'mvn release:prepare' on my laptop to perform a release (say '1.5'), the two commits that occur (changing 1.5-SNAPSHOT to 1.5, then 1.5 to 1.6-SNAPSHOT) are pushed together into my git repo - and Hudson obviously builds the most recent one, ie 1.6-SNAPSHOT - and completely ignores the 1.5 release.
It wouldn't matter so much, but the projects depend on each other, and I would like to declare non-snapshot versions in my poms. However, when project B depends on version 1.5 of project A, it's nowhere to be found in the local maven repository for the hudson user on the Hudson box - because it's never been built - and so the build of project B fails.
It would great if I could make Hudson a little cleverer, and when it sees a maven release version flying through, forces a build and install of that particular version, before proceeding to do a build of the later snapshot commit.
I've been looking through the Hudson plugins, and in particular the 'M2 Release Plugin':
http://wiki.hudson-ci.org//display/HUDSON/M2+Release+Plugin
-however, that plugin seems to be more geared towards manually selecting a build you want to promote up to some more official Maven Repo, rather than forcing Hudson to automatically build & install every release build it comes across.
Update: some of my underlying requirements have led me to rethink what I want to achieve here- apologies for not expressing them earlier:
- Most of the projects are open-source or intended to be open eventually, and I would like anyone to be able to
git clone
any single project, checkout a release tag, and do amvn install
without requiring any other repo for dependencies but maven central. - In order to get consistent results (across my laptop, the hudson server, and other people's checkouts), this obviously indicates a preference for declaring non-snapshot dependencies in my poms (at least for the release versions).
- This led me down the path of trying to get Hudson to 'mvn install' the release artifacts as they whizzed past, so that later, Hudson building project B wouldn't fail when it couldn't find project A's release version (which is where this question came from)
Additionally:
- I use sonotype's wonderful oss hosting, which requires GPG signing - and I don't want to have my GPG key stored on any hardware I can't hold in my hand :) - so bunging it up on the Hudson server in the cloud is not an option.
- Mentally, having the Hudson server do releases is a bit foreign to me - I really just want it for CI.