Spring cloud override config in local (spring boot 2.4 upper)

Viewed 367

In previous Spring Cloud Config Hoxton by set spring.cloud.config.allow-override=true, you can override config in localhost application.yaml.

But in the new Spring Boot 2.4 version and spring.config.import command, setting this property does not change anything, and config does not override in localhost application.yaml.

How can I do this in the new version? Is there any alternative solution for override configs to test in the local environment?

1 Answers

I just added a new e.g. application-dev1.yml in addition to other yml files (in this case besides test) and I set the active profiles in application.yml as below

spring:
  profiles:
    active: test, dev1

It works for me

Related