Is there any way a Jenkins build can be aware of the Maven version number of a project after processing the POM?
I\'ve got some projects where versioning is controll
You could also do :
MAVEN_VERSION=`grep A -2 -B 2 "" pom.xml | grep version | cut -d\> -f 2 | cut -d\< -f 1`-commit-"`echo $GIT_COMMIT`"
Explanation: assuming that you have your project name within a line or two above/below version like a normal pom:
org.apache.bigtop
bigpetstore
1.0-SNAPSHOT
Then you can easily grep for the artifactId, use the "before/after" grep actions to suck in the version with it, and then grep the version out and use the simple unix "cut" command to splice out the content between "version" tags.
I like the Jenkins-groovy integration, but this is alot easier and will work even on a build server which you dont have control over (i.e. because bash is universal).