Use spring.config.activate.on-profile instead of spring.profiles for Boot 3 compatibility. Fixes #1177 (#1182)

Co-authored-by: Ryan Baxter <524254+ryanjbaxter@users.noreply.github.com>
This commit is contained in:
Ryan Baxter
2022-12-15 08:58:35 -05:00
committed by GitHub
parent 5faadf3aa4
commit 34687af510

View File

@@ -635,7 +635,7 @@ public class BootstrapConfigFileApplicationListener
return loaded.stream().map((propertySource) -> {
Binder binder = new Binder(ConfigurationPropertySources.from(propertySource),
this.placeholdersResolver);
String[] profiles = binder.bind("spring.profiles", STRING_ARRAY).orElse(null);
String[] profiles = binder.bind("spring.config.activate.on-profile", STRING_ARRAY).orElse(null);
Set<Profile> activeProfiles = getProfiles(binder, ACTIVE_PROFILES_PROPERTY);
Set<Profile> includeProfiles = getProfiles(binder, INCLUDE_PROFILES_PROPERTY);
return new Document(propertySource, profiles, activeProfiles, includeProfiles);