Getting application version from pom

后端 未结 4 1913
天涯浪人
天涯浪人 2020-12-29 11:30

I have a rest endpoint used to return information about application (so far only app version) But so far this info is hardcoded, and it\'s pretty easy to forget to change it

4条回答
  •  抹茶落季
    2020-12-29 11:59

    There is amazing project named Appinfo, please use it and enjoy! (It has an ugly page, I know - but it works :)

    AppInfo allows to automatically feed your application with a current version number, build date or build number.


    Also excellent Spring Boot Actuator provides feature named Info Endpoint which can publish version information to web or REST.

    By default the Actuator adds an /info endpoint to the main server. It contains the commit and timestamp information from git.properties (if that file exists) and also any properties it finds in the environment with prefix "info".

提交回复
热议问题