I want to put the current git branch into the version field in pom xml. I found some post in the internet suggesting to do something like:
<version>${scm.version}</version>
but this seems not to work with git. Are there any other solutions?
Yes, use the git commit id plugin for maven
It's pretty straightforward. You can use it to get the git branch with
${git.branch}
So in your case it would go:
<version>${git.branch}</version>
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