spring boot loader configuration file location

springboot start position application.properties scans or less application.yml Spring boot file as a default profile
member
-file: ./ config /
-file: ./
-classpath: / config /
-classpath: /
priority from high in the end high-priority configuration will overwrite low priority configuration;

SpringBoot will be loaded from the four positions of all main configuration file; complementary configuration;
we can also change the default configuration file location by spring.config.location
items packed in the future we can use the time-line parameters in the form of project start command to specify the new location of the configuration file; specified configuration file and silent
recognition of these load profiles work together to form a complementary configuration;
the Java -jar the Spring-the boot-config-02 -02-0.0.1-SNAPSHOT.jar --spring.config.location = G: /application.properties

Guess you like

Origin www.cnblogs.com/banml/p/11390605.html