-1

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?

Larry
  • 21
  • 6

2 Answers2

0

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

Ross
  • 1
  • 1
-1

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.

Kan Robert
  • 259
  • 1
  • 10