I would like to obtain a value from a bash shell command and set a property using this value.
I am not sure setting the property is the way to go — what I am trying to do is obtain a value from a shell command that is executed by Maven and to use this value to name the jar that is created.
More specifically, I would like to obtain using the git describe command the tag of a project and append this tag to the name of the jar.
I would like to do something like this within the pom:
tag = git describe
.
.
.
mv ‘$jarname’.jar ‘$jarname$tag’.jar
If I from the command line I execute
mvn jar:jar
I am not sure I can even affect the name of the resultant jar even if I had the git tag,
so that is another question.
What ended up working:
Goal was to be able to store SHA1 and git tag in the manifest of a jar.
Used the Maven plugin found here:
http://code54.com/blog/2012/04/30/buildversion-plugin.html
as well as the Maven buildnumber plugin.
These two plugins respectively set the Maven properties build-tag and buildNumber which
could then be specified in the Maven Jar plugin’s manifestEntries section.