I need to set a variable in my Bamboo plan based on a field in my POM. This variable will then by used by the next task. How can I achieve this?
The full scenario is: I have a plan that branches my project for release. Currently I use two variables to hold the branch name and the next development version number, which is set manually using Run Customised. However if I can read the version number from the pom.xml file, these values can be calculated. So ideally I would like to use a script to:
- read the pom.xml file
- extract the current version number
- manipulate it to determine the branch name and next version, and
- populate two variables to be used by the branching task.
I have looked at the plugin exchange and all that seems promising for this is the Groovy plugin, but this does not seem to work on 4.0 and even then I don't know how to set a plan variable from the script. I'd prefer not to write a custom task for this unless there is really no other way.
Any help would be greatly appreciated