I\'m using maven and my goal is to include the git commit hash in the version number. Something like : 1.1.{git_hash}.
I\'m trying to follow this tutorial.
Q: i
The above accepted answer didn't work for me. I found the link https://dzone.com/articles/maven-git-commit-id-plugin, from where I copied the plugin code below. It worked first time for me. I now have the git.properties file automatically included in my target JAR file. Very useful for tracking.
pl.project13.maven
git-commit-id-plugin
2.2.4
get-the-git-infos
revision
${project.basedir}/.git
git
false
true
${project.build.outputDirectory}/git.properties
json
false
false
-dirty
Add finalName to build section to also have the version in the target file name
${project.artifactId}-${project.version}-${git.commit.id.describe-short}
...