spring boot 启动会扫描以下位置的application.properties或者application.yml文件作为Spring boot的默认配置文件
–file:.//
–file:./
–classpath:/config/
–classpath:/
但是寻找属性的优先级如下:
1、Command line arguments.
2、Properties from SPRING_APPLICATION_JSON (inline JSON embedded in an environment variable or system property).
3、ServletConfig init parameters.
4、ServletContext init parameters.
5、JNDI attributes from java:comp/env
6、Java System properties (System.getProperties()).
7、OS environment variables.
8、A RandomValuePropertySource that has properties only in random.*.
9、Profile-specific application properties outside of your packaged jar (application-{profile}.properties and YAML variants).
10、Profile-specific application properties packaged inside your jar (application-{profile}.properties and YAML variants).
11、Application properties outside of your packaged jar (application.properties and YAML variants).
12、Application properties packaged inside your jar (application.properties and YAML variants).