SpringApplication loads properties from application.properties files in the following locations and adds them to the Spring Environment:

  1. /config subdirectory of the current directory

  2. The current directory

  3. A classpath /config package

  4. The classpath root

-----------------------------------------------------------------------------------

  1. file:./config/

  2. file:./

  3. classpath:/config/

  4. classpath:/

-----------------------------------------------------------------------------------

指定spring.config.additional-location,客户自定义目录

  1. file:./custom-config/

  2. classpath:custom-config/

  3. file:./config/

  4. file:./

  5. classpath:/config/

  6. classpath:/

-----------------------------------------------------------------------------------

program argument >   jvm options > 操作系统环境变量

-----------------------------------------------------------------------------------