配置文件加载位置优先级

Spring-boot启动会扫描以下位置的application.properties或者application.yml文件为Spring-boot的默认配置文件

- file:./config/

- file:./

- classpath:/config/

- classpath:/

 优先级由高到低,高优先级的配置会覆盖低优先级的配置;

Spring-boot会从这四个位置全部加载主配置文件;互补配置

猜你喜欢

转载自www.cnblogs.com/Metroe/p/10456714.html