It works fine as far as the creation of the .jar file is concerned but fails for the creation of the .obr file because it cannot resolve “$buildNumber”:
[ERROR] Failed to execute goal com.atlassian.maven.plugins:maven-confluence-plugin:6.3.15:generate-obr-artifact (default-generate-obr-artifact) on project test: Source '...\target\test-0.3.0.${buildNumber}.jar' does not exist -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
It’s not sophisticated but it works. Maybe you can improve it.
First in your pom.xml write your version with buildnumber, in format <version>1.0.0.0</version>
Then create a new script (e.g. change_buildnumber.sh) into which you can put these few bash commands.
It will increment and replace the buildnumber and it will also create a backup pom.xml.
The commented lines are an alternative method to get the buildnumber from the file buildNumber.properties instead that from pom.xml
Currently I use a script that calls this one before calling atlas-package
Hope this helps
P.S: With this script in my pom.xml I have <finalName>${project.artifactId}-${project.version}</finalName>
Hard to replace awk and sed, yes, but you can do an end run with PowerShell, which can read the XML, treating elements and attributes as properties (a la Groovy, but more compactly (at least in this context)) and then write the XML back out.
Also (this may or may not apply, I’m not familiar with Maven or how it integrates with Bamboo), we use a dummy Bamboo Deployment to increment the build number (since this seems to be the approach that makes Bamboo happiest).