SpringBoot 项目中如果没有依赖 spring-cloud-context 的话,是不会读取bootstrap.properties 文件
也就是说
bootstrap.yml配置是SpringCloud项目才会用到的。 如果你的项目仅仅是一个SpringBoot项目,只会识别application.yml配置文件。
由于SpringCloud是基于SpringBoot构建的,所有SpringCloud项目两种文件都会识别,这个时候才有优先级的说法,SpringCloud项目是会优先读取bootstrap配置在读取application配置。
A Spring Cloud application operates by creating a “bootstrap” context, which is a parent context for the main application. Out of the box it is responsible for loading configuration properties from the external sources, and also decrypting properties in the local external configuration files.
注意:本文归作者所有,未经作者允许,不得转载