我们如何组织不同的配置文件以在 application.properties 中使用 Quarkus 配置文件

How we can organize different config profiles to use Quarkus profile in application.properties

我根据环境有不同的配置文件,需要加载它。我如何实现以及如何为 Quarkus 主应用程序传递程序参数以获取开发配置文件(spring.config.location=classpath:/config/dev/application.yml)

有没有办法在启动@QuarkusMain 时加载数据库配置。我已将所有数据库配置配置为一个 class 以及如何在 main 中加载此 class。请对此提出建议。

Quarkus 1.13(及更高版本)支持配置文件感知 application.properties。只需将您的文件命名为 application-{profile}.properties 并使用 -Dquarkus.profile={profile}

激活它

如果要加载特定文件,也可以使用quarkus.config.locations。这是由 SmallRye Config 支持的。请在此处查看其他文档:https://smallrye.io/docs/smallrye-config/main/config/config.html