<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<twilio-version>6.3.0</twilio-version>
</properties>
Suppose I have the above setup in my pom.xml, is it possible to grab say the java version from it?
My idea is to have Jenkins/JenkinsFile to run some say 'maven GRAB_PARAM PARAM_NAME' method and use whatever the value to setup its build environment.
So my JenkinsFile would be:
node {
stage 'Clean Up'
deleteDir()
stage 'Env Setup'
def mvnHome = tool '3.0.3'
env.JAVA_HOME = THE_MVN_COMMAND_THAT_CAN_GRAB_VERSION_FROM_POM
stage 'Compile/Package'
checkout scm
sh "${mvnHome}/bin/mvn clean install -DskipTests"
}
I also wanna use this so I can easily grab the build version from previous build etc...