Configuration file placeholder || Profile - 1, multi-Profile document 2, yml support multiple blocks of Embodiment 3, the activation profile is specified,

Profiles placeholder


1, a random number

2, the configuration of the placeholder value acquired previously, may be used if no: to specify default values



Profile

1, multi-file Profile

We in the preparation of the master configuration file, the file name can be application- {profile} .properties / yml

Application.properties use the default configuration;

2, yml support multiple block the way

3, activate the specified profile

1, specified in the configuration file --spring.profiles.active = dev

2, the command line:

​ java -jar spring-boot-02-config-0.0.1-SNAPSHOT.jar --spring.profiles.active=dev;

Directly in the test, configure incoming command line parameters

3, the virtual machine parameters;

​ -Dspring.profiles.active=dev

Published 434 original articles · won praise 105 · views 70000 +

Guess you like

Origin blog.csdn.net/qq_39368007/article/details/104951775