The small partners in the work will always encounter a variety of wonderful needs, today to everyone talk about how maven in Jenkins get Subversion version number.
Jenkins's own environment variable contains a number of useful parameters, see details: http://xxxx/env-vars.html
From the environment variables can be found, we can directly get to Subversion version number.
The most important point is solved, and we'll find a way to get maven to get the parameters of the Jenkins environment variable.
MAVEN provides its own solution:
As mentioned in the No. 266 page of the Maven authoritative guide, there are implicit properties in any Maven project, and the implicit properties are:
project.*
MAVEN's Project object Model (POM). You can use the project.* prefix to refer to any value in the Maven Pom.
settings.*
Maven Settings. You use the settings.* prefix to refer to the value of MAVEN settings in the ~/.m2/settings.xml file
env.*
Environment variables such as path and m2_home can all be referenced using the env.* prefix.
By the above introduction know, can pass ${env. The svn_revision} parameter gets the Subversion version number in Jenkins.
Well, Maven has gotten what it needs. Now you can do whatever you want. O (∩_∩) o haha ~
Finally, I will give you a picture of my test, there is a picture of the truth amount:
Go: http://www.cnblogs.com/zz0412/p/jenkins_jj_15.html Click to open link