Hi,
I am working on automating the maven release process in a Bamboo plan.
In a Maven task I have the following release:prepare command using both global and plan variables:
release:prepare --batch-mode -Dusername=${bamboo.custom.svn.username} -Dpassword=${bamboo.scmPassword} -DdevelopmentVersion=${bamboo.snapshotVersion} -DreleaseVersion=${bamboo.releaseVersion}
Both variables ${bamboo.snapshotVersion} and ${bamboo.releaseVersion} are defined at plan level.
Actually, the intent behind setting the maven parmateres "developmentVersion" and "releaseVersion" is to pass a customized version number. But by this way, the users must each time run a customized build and passes the correct parameter values.
Now I need to configure my Bamboo plan, to achieve both use cases in one plan:
1- Pressing "run build" without passing the values for the version variables just leaves the maven release plugin to determine the next development version.
2- Using "run customized build" and overriding both variables will produce the given version numbers for release and snapshot.
While searching I found these 2 interesting plugins:
The first (beta) plugin "bamboo-maven-version-update-plugin" offers the possibility to auto-increment the version values in both variables, in case they might be forgotten. But it can't sync the snapshotVersion variable with the POM’s version to make sure they’re the same value.
While the second one "Maven POM Value Extractor" can keep the plan variable ${bamboo.snapshotVersion} in sync with the POM element "<version>" before performing release:prepare. But the value for ${bamboo.releaseVersion} in turn will still have to be set manually.
I thought I could define 2 tasks by using both plugins before performing the release:prepare task to:
1. Keep the plan variable ${bamboo.snapshotVersion} in sync with <version> element in POM.
2. Auto-increment the ${bamboo.snapshotVersion} variable if not given explicitly by the user.
But I didn't find a way to "auto determine" the ${bamboo.releaseVersion} value if not given.
Is it even possible to achieve this?
Regards,
Wahid