根据 Spring 文档 及这个 StackOverflow 回答,Spring Boot 默认会去依次这几个地方找外置配置文件(.properties
/ .yml
):
/config
subdirectory of the current directory/config
package这个「外置配置文件」对应这个 文档 中的「Application properties outside of your packaged jar (application.properties and YAML variants)」。