Update `SpringBootContextLoader` to both add `spring.profiles.active`
properties and to directly call `Environment.setActiveProfiles`.
The additional `setActiveProfiles` call prevents `AbstractEnvironment`
from accidentally loading `spring.profiles.active` properties directly
when `doGetActiveProfiles` is called.
Directly setting active profiles has only become necessary since we
started adding properties using the square bracket notation. Previously
we added a comma-separated list which would be picked up by both the
`AbstractEnvironment` and the `ConfigurationFileApplicationListener`.
Closes gh-21302
Update `SpringBootContextLoader` so that it correctly deals with an
`@ActiveProfiles` annotation that contains a comma.
Fixes gh-19537
Co-authored-by: Scott Frederick <sfrederick@pivotal.io>
Co-authored-by: Andy Wilkinson <awilkinson@pivotal.io>
For consistency with SpringApplication, this commit disables bean
overriding by default in ApplicationContextRunner. Bean overriding can
be enabled again using withAllowBeanDefinitionOverriding.
Closes gh-18019
This commit changes uses of ClassLoader.loadClass to Class.forName for
consistency with what was initiated in #19342 and better compatibility
with GraalVM.
Closes gh-19824
Update all dependencies declarations to use the form `scope(reference)`
rather than `scope reference`.
Prior to this commit we declared dependencies without parentheses unless
we were forced to add them due to an `exclude`.
Replace Gradle single quote strings with the double quote form
whenever possible. The change helps to being consistency to the
dependencies section where mostly single quotes were used, but
occasionally double quotes were required due to `${}` references.
This paves the way for publishing Gradle module metadata once the
problem caused by snapshot versions and our two-step publication
process has been addressed.
See gh-19609
This reverts commit b34a311d02 as,
having disabled the publishing of Gradle's module metadata (4f75ab5),
the changes are no longer needed.
See gh-19609
Previously, enforcedPlatform dependencies were using to pull in the
constraints defined in spring-boot-dependencies and
spring-boot-parent and applied them strictly so that the constrained
version had to be used. This worked as intended in Spring Boot's own
build but incorrectly enforced those same strict version requirements
on external consumers of Spring Boot's modules.
This commit reworks how Spring Boot defines its internal dependency
management so that platform dependencies are exposed to external
consumers while enforced platform dependencies are using internally.
See gh-19609
Prior to this commit, active profiles were being added to the Spring Boot
application environment by setting the `spring.profiles.active` property.
This could result in profiles getting parsed differently than other uses of `@ActiveProfiles`.
Setting the profiles directly in the `Environment` prevents this parsing.
See gh-19556