springboot启动会扫描以下位置的application.properties或者application.yml文件作为springboot的默认配置文件:
- file:./config/
- file:./
- classpath:/config/
- classpath:/
以上是按照优先级从高到低的顺序,所有位置的文件都会被加载,高优先级配置内容会覆盖低优先级配置内容。(互补配置)
还可以通过spring.config.location来改变默认的配置文件位置:
spring.config.location=文件绝对路径