Printing the version of a Maven project

September 15, 2021 [Java, Programming, Tech]

To print a Maven project's version number, try:

mvn help:evaluate -Dexpression=project.version -q -DforceStdout

-q suppresses all output(!)

-DforceStdout unsuppresses the actual thing you asked to be printed.

I will refrain from commenting on how difficult this was to find.