I would like to get the group ID, artifact ID, and Maven project version from the command line.
The proposed solution in this topic " How to get the version of the Maven project on the bash command line " is to use the following plugin:
mvn org.apache.maven.plugins:maven-help-plugin:2.2:evaluate -Dexpression=project.artifactId
This works well, but I cannot figure out how to set project.groupId, project.artifactId & project.version to the -Dexpression argument at the same time.
I would not start the Maven command 3 times with a different argument -Dexpression every time ...
Thks
At the moment I am receiving data by following these steps:
local pom_groupid='mvn org.apache.maven.plugins:maven-help-plugin:2.2:evaluate -Dexpression=project.groupId |grep -Ev '(^\[|Download\w+:)'' local pom_artifactid='mvn org.apache.maven.plugins:maven-help-plugin:2.2:evaluate -Dexpression=project.artifactId |grep -Ev '(^\[|Download\w+:)'' local pom_version='mvn org.apache.maven.plugins:maven-help-plugin:2.2:evaluate -Dexpression=project.version |grep -Ev '(^\[|Download\w+:)''
source share