[英]Custom config file with eclipse microprofile-config
I want to select .properties file at runtime. 我想在运行时选择.properties文件。 Is it possible with microprofile-config?
microprofile-config是否可以? So, instead of using META-INF/microprofile-config.properties I would like to use an external file:
因此,我不想使用META-INF / microprofile-config.properties,而是要使用一个外部文件:
java -jar mymicroprofileapp.jar -s my.properties
I know, it is possible to write custom config source, but I wonder if there is a built-in option to define the config file and so avoiding repeating the code in each project 我知道,可以编写自定义配置源,但是我想知道是否有内置选项来定义配置文件,因此避免在每个项目中重复代码
The web site tells us the three options: 该网站告诉我们三个选项:
System.getProperties()
System.getenv()
META-INF/microprofile-config.properties
. META-INF/microprofile-config.properties
。 I addition to these you can register ConfigSources
. 除了这些,您还可以注册
ConfigSources
。
There is no build-in option for what you want. 没有您想要的内置选项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.