DEV Community

loading...

Discussion on: Parsing maven version with bash

Collapse
khmarbaise profile image
Karl Heinz Marbaise

I would like to suggest a simpler and safer solution:

VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version))

And if you have a ci agent you can run Maven on it...or you can use the CI like Jenkins and read the pom file like this:
github.com/jenkinsci/pipeline-exam...

Usually using a CI will do the installation of Maven automatically on the node for example as Jenkins does...