springboot: 2.5.14 when I set "spring.config.activate.on-profile", all field of StaticConfig are null. But it works well for "spring.profiles.active" SpringBoot spring.config.activate.on-profile makes empty inject bean This is a simple project untitled1.tar.gz

Comment From: wilkinsona

spring.profiles.active configures the profiles that are active.

spring.config.activate.on-profile indicates that the configuration should only be active when the named profile is active. In your screenshot above I can just see that only the default profile is active so the configuration has not been applied. Please refer to the documentation for further details.

Also, please note that Spring Boot 2.5.x is no longer supported. You should upgrade to 2.6.x or 2.7.x as soon as possible.

Comment From: lfz757077613

ohh, I was wrong. Only spring.profiles is deprecated, spring.profiles.active still works. When I see ConfigFileApplicationListener has @Deprecated, I thought all of spring.profiles* config should be replaced by spring.config*.

Thanks for reply