I'm trying to fetch the version of my maven project as part of of the deployment process, but I seem to be getting an error on the command's output. Any ideas?
I have Maven help in my pom.xml plugins.
Here's the step I'm running:
- name: Get version
run: |
VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout )
echo "::set-output name=version::$VERSION"
id: get_version
Here's the output (note: I've removed -q here so I can see the output). Note that the project that is defaulted is what I'm looking for. I'm trying to get the v0.1 as my output!
[INFO] No artifact parameter specified, using 'com.xyz:abc-123:war:v0.1' as project.
[INFO]
null object or invalid expression
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.569 s
[INFO] Finished at: 2020-08-29T13:52:22Z
[INFO] ------------------------------------------------------------------------
I am using the help 3.2.0
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-help-plugin</artifactId>
<version>3.2.0</version>
</plugin>