一、默认的SpringBoot项目是不会加载bootstrap文件的。
只有配置了SpringCloud相关依赖,由SpringCloud加载启动时,才会加载bootstrap配置文件。
二、配置文件加载顺序
bootstrap.yml
> bootstrap.properties
> application.yml
> application.properties
>${spring.application.name}-${spring.cloud.config.profile}.yml
>${spring.application.name}-${spring.cloud.config.profile}.properties
三、配置属性值优先级
按照步骤二的加载顺序,后加载的配置属性值会覆盖掉先加载的属性值。
四、与某搜索网站搜索结果是相反的
自己动手,搭建一个试一试,比看什么资料都强