I tried locally that the application will be covered, but when I checked online, many people said that the bootstrap would not be covered by the bootstrap, so I was very confused.
Is it because of different versions?
I tried locally that the application will be covered, but when I checked online, many people said that the bootstrap would not be covered by the bootstrap, so I was very confused.
Is it because of different versions?
In spring doc, there said:
By default, bootstrap properties (not bootstrap.properties but properties that are loaded during the bootstrap phase) are added with high precedence, so they cannot be overridden by local configuration.
If you defined a non-bootstrap properties, it will override bootstrap.yml
In fact, this problem is the priority of the springboot
configuration file.
In springboot
, the priority of bootstrap
is higher than application
, so if both parties have the same properties, bootstrap
will be loaded first, then the application
configuration will be loaded, and then the same properties of the former will be overwritten Lose.
The springBoot
convention is greater than the configuration, the configuration follows from the inside to the outside, the outer layer covers the inner layer, and bootstrap
is configured in the spring applicationContext
stage, while application
is configured in the application layer, so the external will Replace the inner layer.