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.
I'm sure there are many other similar plugins out there, but you can use my exec-set-property plugin goal to set a Maven property using the output of a shell command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With