https://stackoverflow.com/questions/32997352/what-is-the-difference-between-putting-a-property-on-application-yml-or-bootstra
I have just asked the Spring Cloud guys and thought I should share the info I have here.
bootstrap.yml is loaded before application.yml.
It is typically used for the following:
when using Spring Cloud Config Server, you should specify spring.application.name and spring.cloud.config.server.git.uri inside bootstrap.yml
some encryption/decryption information
Technically, bootstrap.yml is loaded by a parent Spring ApplicationContext. That parent ApplicationContext is loaded before the one that uses application.yml.
本文探讨了Spring Boot项目中bootstrap.yml与application.yml的加载顺序及用途。bootstrap.yml通常用于配置Spring Cloud Config Server相关信息及加密/解密信息,因其在application.yml之前加载,适用于更早期的配置需求。
1689

被折叠的 条评论
为什么被折叠?



