Following the Jenkins documentation jenkins docs
I can use the POM_VERSION environment variable to take the current version from the pom file.
But for some reason, the POM_VERSION environment variable is not updated from assembly to assembly. for example: I changed the version number manually, but the assembly number that was exported was the last of the previous assembly.
From my python script:
print 'Current version is ' + os.environ['POM_VERSION']
which gives the next log Current version is 0.1.5, which is clearly incorrect because I changed it. you can see it in my maven goal release:
[INFO]
[INFO] --- versions-maven-plugin:2.1:set (default-cli) @ ep-reporter ---
[INFO] Searching for local aggregator root...
[INFO] Local aggregation root: /var/lib/jenkins/jobs/exchange-planner- reporter/workspace
[INFO] Processing com.exelate:ep-reporter
[INFO] Updating project com.company:ep-reporter
[INFO] from version 0.1.8 to 0.1.6
Props: {project.version=0.1.6, project.artifactId=ep-reporter, project.groupId=com.company}
Notice that it went from 0.1.5 because I have a script that promotes it. but maven clearly states that it changes it from 0.1.8 to 0.1.6, which does not match POM_VERSION
Thank.