我设计了这样的配置文件:
application.yaml
application-a.yaml
application-b.yaml
并使用spring.profiles.include
递归加载配置文件。
,它是
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的开发人员,感谢您阅读本文。是否值得修复?