我想在运行时选择.properties文件。可以使用microprofile-config吗?因此,我不使用META-INF/microprofile-config.properties,而是使用外部文件:
java -jar mymicroprofileapp.jar -s my.properties我知道,可以编写自定义的配置源,但我想知道是否有内置的选项来定义配置文件,从而避免在每个项目中重复代码
发布于 2019-07-30 22:49:40
The web site告诉我们有三个选项:
System.getProperties()System.getenv()META-INF/microprofile-config.properties.除了这些之外,你还可以注册ConfigSources。
对于你想要的东西没有内置的选项。
https://stackoverflow.com/questions/57274375
复制相似问题