What is exact difference between spring.profiles.active and spring.config.activate.on-profile?
"WARN","msg":"Property 'spring.profiles' imported from location 'class path resource [application.yaml]' is invalid and should be replaced with 'spring.config.activate.on-profile' [origin: class path resource [application.yaml]
spring.profiles.active can be used to specify which profiles are always active.
An example from the documentation:
spring: profiles: active: "production"
spring.config.activate.on-profile (known as spring.profiles before Spring Boot 2.4) can be used to mark a configuration file segment profile-specific.
An example from the documentation:
server: port: 9000 --- spring: config: activate: on-profile: "development" server: port: 9001 --- spring: config: activate: on-profile: "production" server: port: 0In the preceding example, the default port is 9000. However, if the Spring profile called ‘development’ is active, then the port is 9001. If ‘production’ is active, then the port is 0.
Another change in Spring Boot 2.4 was that the spring.profiles.active property is no longer allowed in combination with spring.config.activate.on-profile. (See this blog post for details.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With