如何在 Quarkus 运行时检测构建时间?

问题描述

我对 Quarkus 很陌生,我似乎无法找到一种方法获取构建信息,例如构建版本或运行时上次构建的时间。任何见解将不胜感激。

解决方法

您需要配置 Maven 以在 application.properties 中记录该信息。 类似:How to access maven.build.timestamp for resource filtering

然后在运行时您将读取属性并提取您需要的内容。可能类似于 How to read properties file inside jar?