Use data binding to access spring.profiles .active and .include
Previously, spring.profiles.active and spring.profiles.include were
looked up manually. This meant that configuration that used indexes
(for example spring.profiles.active[0]=dev) were not bound. As a
result, YAML lists did not work.
This commit updates ConfigFileApplicationListener to use a
RelaxedDataBinder to retrieve the values of spring.profiles.active
and spring.profiles.include, thereby reusing the data binding logic
that supports property names with indexes.
See gh-6995
@ -390,8 +393,8 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
@@ -390,8 +393,8 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
}
// Any pre-existing active profiles set via property sources (e.g. System
// properties) take precedence over those added in config files.
@ -506,12 +509,23 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
@@ -506,12 +509,23 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
@ -540,16 +554,6 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
@@ -540,16 +554,6 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
@ -750,4 +754,48 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
@@ -750,4 +754,48 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,