Spring boot offers out-of-the-box support for git-commit-id-plugin
, where you can bind git properties to Spring variables. However heroku cannot work with this.
After some reading up, it appears that the hidden .git
subfolder is not pushed to heroku. Since during build time the git.properties
file is generated and saved in the target
folder, the git-commit-id-plugin will fail as there is no .git
subfolder.
Then I stumbled on the heroku-maven-plugin
. This plugin allows to build your project locally and then push the artifact to heroku - and that’s what I need.
Just go through the instructions that are very clear and complete - I had to configure maven to deploy the stand-alone jar file. And it works :)