Remove hard-coded project version #759
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This removes the hard-coded project version from the
pom.xmlandapplication.yml, so git tags and code cannot get out of sync.revisionproperty to enable command line override ofproject.versionin pom(set default to
dev, so it's clear when version is not provided)project.versiontoopenapi.versioninapplication.ymlproject.versionusing git tag in github docker build workflowgit describein the generatedgit.propertiesfile, by including lightweight tagsfixes #624
notes
/actuator/info(client "about" link) already comes from the git ref, and so does the version in the docker image name.project.versiondirectly in the pom, there would be no need to modify the github workflows and Dockerfile. However, althoughgit-commit-id-maven-plugincan expose the git info to the pom, I don't think this can be used to set the mavenproject.versiondirectly. For example,${git.commit.id.describe-short}is not evaluated when used inside the project version tag, despite enablinginjectAllReactorProjectsin the plugin config.