title: How to get maven version in Jenkins pipeline
body: <p>I am creating CI pipeline with Jenkins. Need to tag the docker images with the Maven version of the project, e.g. <code>0.0.1-SNAPSHOT</code>.</p>
  
  <p>Although, maven version is exposed as <code>POM_VERSION</code> based on <a href="https://issues.jenkins-ci.org/browse/JENKINS-20594" rel="nofollow noreferrer">this Jenkins issue</a>, it seems to apply only to the "Maven project". I tried to use the variable in Pipeline's Jenkins file as <code>${POM_VERSION}</code> and it did not recognize the property.</p>
  
  <p>What is the best way to get the version number? Parse the pom.xml and grep the version with a bash script and call it inside <code>Jenkinsfile</code>?</p>