Skip to content

Commit fee8aa0

Browse files
committed
Merge branch '3.4.x'
Closes gh-45551
2 parents e0a23e5 + 6c02f58 commit fee8aa0

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/external-config.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Property values can be injected directly into your beans by using the javadoc:or
88

99
Spring Boot uses a very particular javadoc:org.springframework.core.env.PropertySource[] order that is designed to allow sensible overriding of values.
1010
Later property sources can override the values defined in earlier ones.
11+
12+
[[features.external-config.order]]
1113
Sources are considered in the following order:
1214

1315
. Default properties (specified by setting javadoc:org.springframework.boot.SpringApplication#setDefaultProperties(java.util.Map)[]).

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/profiles.adoc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,19 @@ spring:
5353
active: "metrics"
5454
----
5555

56+
The configprop:spring.profiles.active[] property follows the same ordering rules as other properties.
57+
The highest javadoc:org.springframework.core.env.PropertySource[] wins.
58+
This means that you can specify active profiles in `application.properties` and then *replace* them by using the command line switch.
59+
60+
TIP: See xref:features/external-config.adoc#features.external-config.order[the "`Externalized Configuration`"] for more details on the order in which property sources are considered.
61+
5662

5763

5864
[[features.profiles.adding-active-profiles]]
5965
== Adding Active Profiles
6066

61-
The configprop:spring.profiles.active[] property follows the same ordering rules as other properties: The highest javadoc:org.springframework.core.env.PropertySource[] wins.
62-
This means that you can specify active profiles in `application.properties` and then *replace* them by using the command line switch.
63-
6467
Sometimes, it is useful to have properties that *add* to the active profiles rather than replace them.
65-
The `spring.profiles.include` property can be used to add active profiles on top of those activated by the configprop:spring.profiles.active[] property.
68+
The configprop:spring.profiles.include[] property can be used to add active profiles on top of those activated by the configprop:spring.profiles.active[] property.
6669
The javadoc:org.springframework.boot.SpringApplication[] entry point also has a Java API for setting additional profiles.
6770
See the `setAdditionalProfiles()` method in javadoc:org.springframework.boot.SpringApplication[].
6871

@@ -77,6 +80,10 @@ spring:
7780
- "local"
7881
----
7982

83+
NOTE: Included profiles are added before any configprop:spring.profiles.active[] profiles.
84+
85+
TIP: The configprop:spring.profiles.include[] property is processed for each property source, as such the usual xref:features/external-config.adoc#features.external-config.typesafe-configuration-properties.merging-complex-types[complex type merging rules] for lists do not apply.
86+
8087
WARNING: Similar to `spring.profiles.active`, `spring.profiles.include` can only be used in non-profile-specific documents.
8188
This means it cannot be included in xref:features/external-config.adoc#features.external-config.files.profile-specific[profile specific files] or xref:features/external-config.adoc#features.external-config.files.activation-properties[documents activated] by `spring.config.activate.on-profile`.
8289

0 commit comments

Comments
 (0)