注:优先级指的是配置属性生效的优先级 不是读取文件的优先级

  所有配置文件都去读取的话 生效属性优先级高的读取的优先级反而低

 

1.

默认位置配置文件的优先级
1.–file:./config/
2.–file:./
3.–classpath:/config/
4.–classpath:/

springboot配置文件优先级_其他

 

 

2.properties和yml优先级:properties > yml

 3.若启动命令带--spring.config.location=  那么配置文件从其它地方读取 以上所有属性都会失效