I am having one pom.xml and I am building maven project in Jenkins. I want to print stuff like: Artifactid, Version, group ID. Which is present in pom.
I want to do it Jenkins itself without any plugins. Any help would be appreciated.
I am having one pom.xml and I am building maven project in Jenkins. I want to print stuff like: Artifactid, Version, group ID. Which is present in pom.
I want to do it Jenkins itself without any plugins. Any help would be appreciated.
You can do this with the maven help plugin. Just use a "Execute Shell" Build Blog and write some bash code like this:
version=$(mvn help:evaluate -Dexpression=project.version | egrep -v "INFO|WARNING|ERROR")
echo $version
You can also check the topic How to get Maven project version to the bash command line for more possible solutions.