Outside of arrangement

PropertySource order:

1, devtools global set properties at home directory (~ / .spring-boot - devtools.properties, if devtools activated).
2, @TestPropertySource comment on the test cases.
3, @ SpringBootTest # properties on test case notes.
4, command line parameters
5, the attributes from SPRING_APPLICATION_JSON (system environment variables or attributes embedded inline JSON).
6, ServletConfig initialization parameters.
7, ServletContext initialization parameters.
8, from the Java: CoMP / the env the JNDI properties.
9, Java system properties (System.getProperties ()).
10, the operating system environment variables.
11, RandomValuePropertySource, contains only Random. * In the property.
12, no scoring Profile jar package -specific application attribute (Application- {} .properties Profile YAML and variables).
13, scored Profile jar package -specific application attribute (Application- {} .properties Profile YAML and variables).
14, the application is not configured into the jar package (and the application.properties YAML variables).
15, hit into the application configuration (and the application.properties YAML variable) JAR package. 
16, @PropertySource comment on @Configuration class. 
17, default attributes (using SpringApplication.setDefaultProperties specified).

 

Guess you like

Origin www.cnblogs.com/yaoyuan2/p/11742302.html