SpringBoot系列之外部配置用法简介
引用Springboot官方文档的说法,官方文档总共列举了如下用法:
1、Devtools global settings properties on your home directory (~/.spring-boot-devtools.properties when devtools is active).
2、@TestPropertySource annotations on your tests.
3、properties attribute on your tests. Available on @SpringBootTest and the test annotations for testing a particular slice of your application.
4、Command line arguments.
5、Properties from SPRING_APPLICATION_JSON (inline JSON embedded in an environment variable or system property).
6、ServletConfig init parameters.
7、ServletContext init parameters.
8、JNDI attributes from java:comp/env.
9、Java System properties (System.getProperties()).
10、OS environment variables.
11、A RandomValuePropertySource that has properties only in random.*.
12、Profile-specific application properties outside of your packaged jar (application-{profile}.properties and YAM