使用 Spring,我可以使用以下命令包含具有非默认名称的配置文件:
public static void main(String[] args) {
/*
This allows us to add an additional configuration file to the default configuration.
By using the `spring.config.name` property, we can specify the order of property files to load from the `spring.config.location` that we specify on startup (if not specified, it assumes the default). This also respects profiles as well.
*/
ConfigurableApplicationContext applicationContext = new SpringApplicationBuilder(DirectconnectEdgeserviceApplication.class)
.properties("spring.config.name:application,secrets")
.build().run(args);
}
Run Code Online (Sandbox Code Playgroud)
它使用 Spring 属性spring.config.name来指定配置文件将被命名为application*或secrets*.
我可能可以导入io.micronaut.spring.context并使用 MicronautApplicationContext,但我想知道是否有办法在普通 …
micronaut ×1