Spring : Spring配置文件加载位置

1.美图

在这里插入图片描述

2.概述

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

file:./config/
filet:./
classpath:/config
classpath:./

➢ 以上是按照优先级从高到低的顺序,所有位置的文件都会被加载,高优先级配置内容会覆盖低优先级配置内容。
➢ 我们也可以通过配置spring.config.location

猜你喜欢

转载自blog.csdn.net/qq_21383435/article/details/105018747