spring-boot冗余地读取配置文件

时间:2017-12-08 10:26:46

标签: spring-boot

我设计了这样的配置文件:

application.yaml
application-a.yaml
application-b.yaml

并使用spring.profiles.include递归加载配置文件。

<{1>}中的

,它是

application.yaml
<{1>}中的

,它是

spring.profiles.include: a

然后我运行application-a.yaml标志和日志输出,如下所示

spring.profiles.include: b

似乎--debug收到来自Spring Application:597 --- The following profiles are active: a,b # that's right o.s.boot.context.config.ConfigFileApplicationListener:172 --- Loaded config file o.s.boot.context.config.ConfigFileApplicationListener:172 --- Skipped (empty) config file o.s.boot.context.config.ConfigFileApplicationListener:172 --- Loaded config file o.s.boot.context.config.ConfigFileApplicationListener:172 --- Skipped (empty) config file o.s.boot.context.config.ConfigFileApplicationListener:172 --- Skipped (empty) config file o.s.boot.context.config.ConfigFileApplicationListener:172 --- Loaded config file o.s.boot.context.config.ConfigFileApplicationListener:172 --- Skipped (empty) config file o.s.boot.context.config.ConfigFileApplicationListener:172 --- Skipped (empty) config file o.s.boot.context.config.ConfigFileApplicationListener:172 --- Skipped (empty) config file 的多余事件。

也许它可以改进,因为它影响很小。

如果您是Spring Boot Project的开发人员,感谢您阅读本文。是否值得修复?

0 个答案:

没有答案