Skip to content

Conversation

@dennisvang
Copy link
Contributor

@dennisvang dennisvang commented Aug 25, 2025

This removes the hard-coded project version from the pom.xml and application.yml, so git tags and code cannot get out of sync.

  • use maven revision property to enable command line override of project.version in pom
    (set default to dev, so it's clear when version is not provided)
  • assign project.version to openapi.version in application.yml
  • override project.version using git tag in github docker build workflow
  • fix output of git describe in the generated git.properties file, by including lightweight tags

fixes #624

notes

  • The version returned by /actuator/info (client "about" link) already comes from the git ref, and so does the version in the docker image name.
  • If we could assign the git tag to project.version directly in the pom, there would be no need to modify the github workflows and Dockerfile. However, although git-commit-id-maven-plugin can expose the git info to the pom, I don't think this can be used to set the maven project.version directly. For example, ${git.commit.id.describe-short} is not evaluated when used inside the project version tag, despite enabling injectAllReactorProjects in the plugin config.

@dennisvang dennisvang marked this pull request as ready for review August 25, 2025 17:51
@dennisvang dennisvang changed the title Project version based on git tag Consistent project versioning Aug 25, 2025
@dennisvang dennisvang force-pushed the maintenance/issue624 branch from ea818fd to b4d0436 Compare August 26, 2025 07:32
this way we never need to update, and it is immediately clear if no version override is supplied
…escribe

this is necessary because tags created via the github release page are lightweight instead of annotated

the output of describe can be found in the generated META-INF/git.properties file
@dennisvang dennisvang changed the title Consistent project versioning Remove hard-coded project version Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Single source of truth for version

2 participants