我想在运行时选择.properties 文件。可以使用 microprofile-config 吗?因此,我不想使用 META-INF/microprofile-config.properties,而是使用外部文件:
java -jar mymicroprofileapp.jar -s my.properties
我知道,可以编写自定义配置源,但我想知道是否有一个内置选项来定义配置文件,从而避免在每个项目中重复代码
最佳答案
The web site告诉我们三个选项:
System.getProperties()
System.getenv()
META-INF/microprofile-config.properties
。
除此之外,您还可以注册ConfigSources
。
没有内置选项可以满足您的需求。
关于java - 使用 eclipse microprofile-config 自定义配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57274375/