Browse Source

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>
pull/1188/head
Ryan Baxter 2 years ago committed by GitHub
parent
commit
34687af510
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/BootstrapConfigFileApplicationListener.java

2
spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/BootstrapConfigFileApplicationListener.java

@ -635,7 +635,7 @@ public class BootstrapConfigFileApplicationListener @@ -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);

Loading…
Cancel
Save