I am using the maven release plugin to create branches and to release our stack. We are using subversion.
We branch from trunk when we are near to release date.
We develop features for this release on the new branch. We develop new features on trunk.
We release from the branch when we think it's ready (consider this a release candidate) We test the release, and release (to staging) when tests have passed.
If we need to release again if tests failed we release from the branch. Maven release plugin neatly increases the patch version (we version projects PROJECT-major.minor.patch) on the commit that goes into our tag directory (we version projects PROJECT-major.minor.patch) during each release from branch.
So far so good. Only that the trunk patch version does not change during each release, so I feel there is a risk our version numbers will get bungled.
The only way around it seems to be to branch from trunk before each release, but this has a whole bunch of other problem associated with it.
Is there a maven way to maintain the artifactIds SNAPSHOT version so that it is always 1 greater than the released version? I'm looking for an automated way, so I do not have to inspect the released pom and compare to the trunk pom with some other tool.
Or could we do flip it on it's head: create a new branch for new features, and keep developing on trunk for the current release, and agree we always branch+release (and never branch+release+release+etc), when we want to release a project?
Once it's released to production, we merge the new feature branch into trunk? Can maven do this?