xiayy860612 / blog-articles

GNU General Public License v3.0
0 stars 0 forks source link

Spring FAQ #5

Open xiayy860612 opened 4 years ago

xiayy860612 commented 4 years ago
xiayy860612 commented 4 years ago
  1. 启动命令行
  2. 环境变量
  3. 包外的具体环境的配置文件(application-{profile}.properties and YAML)
  4. 包内的具体环境的配置文件(application-{profile}.properties and YAML)
  5. 包外的通用配置文件(application.properties and YAML)
  6. 包内的通用配置文件(application.properties and YAML)

配置文件的读取顺序:

  1. 当前目录下的/config
  2. 当前目录
  3. classpath下的/config
  4. classpath的根目录

详细版