问题描述
我有一个休息端点用于返回有关应用程序的信息(到目前为止只有应用程序版本)
但到目前为止这个信息是硬编码的,并且很容易忘记更改它。
我最好从pom或manifest文件中检索app版本。是否有任何项目带来这样的功能?
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.I will be better to retrieve app version from pom or manifest file. Is there any project that brings such functionality?
推荐答案
有一个名为,请使用它并享受! (它有一个丑陋的页面,我知道 - 但它有效:)
There is amazing project named Appinfo, please use it and enjoy! (It has an ugly page, I know - but it works :)
同样优秀提供了名为,可以发布版本信息到网络或REST。
Also excellent Spring Boot Actuator provides feature named Info Endpoint which can publish version information to web or REST.
这篇关于从pom获取应用程序版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!