Very often, when working on projects, you need to get the version of the pom.xml application from the command line.
Here’s how you can do it:
Using help:evaluate
1 2 |
$ mvn help:evaluate -Dexpression=project.version | grep -e '^[^\[]' 1.0 |
1 2 |
$ mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[' 1.0 |
Need read version in java? Check this example.
Recomended books:
One Comment on “Get maven project version from the terminal”