You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@ActiveProfiles replaces profiles from SPRING_PROFILES_ACTIVE environment variable with its value in 2.3.0.M4, but it appends its value to profiles from the environment variable in 2.3.0.RC1.
I'm not sure if this is an intentional change or more appropriate, but I'm sharing this as I didn't see any explicit mention from its release notes or issue assigned to its milestone.
SpringApplication makes a call to environment.getActiveProfiles() which has a side-effect of setting active profiles if they haven't been set before. At this point, Spring Framework, sets the active profiles from the spring.profiles.active. Since the SpringBootContextLoader adds them as indexed properties now, those do not override SPRING_PROFILES_ACTIVE at this point.
I think the change made for #21006 also means that if there's a system property such as spring.profiles.active[0] and an environment variable SPRING_PROFILES_ACTIVE, the system property won't override the environment variable but instead both will be added as active profiles.
philwebb
changed the title
Behavioral change in @ActiveProfiles
The @ActiveProfiles annotation no longer overrides those defined in property files
May 9, 2020
@ActiveProfiles
replaces profiles fromSPRING_PROFILES_ACTIVE
environment variable with its value in 2.3.0.M4, but it appends its value to profiles from the environment variable in 2.3.0.RC1.I'm not sure if this is an intentional change or more appropriate, but I'm sharing this as I didn't see any explicit mention from its release notes or issue assigned to its milestone.
This can be produced with
ActiveProfilesTests
from this sample.If the following environment variable is defined, the test will pass with 2.3.0.M4, but it will fail with 2.3.0.RC1:
The text was updated successfully, but these errors were encountered: