From 3ae1c111a009b2d788efcd69ab870f07fc43e7a3 Mon Sep 17 00:00:00 2001 From: vsanna Date: Tue, 28 May 2024 13:55:38 +0900 Subject: [PATCH] Warn in the documentation that spring.profiles.group can only be used in non-profile-specific documents See gh-40918 --- .../src/docs/asciidoc/features/profiles.adoc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/profiles.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/profiles.adoc index b76554a076d..89837251d1b 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/profiles.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/profiles.adoc @@ -31,8 +31,8 @@ The name of the default profile is `default` and it can be tuned using the confi default: "none" ---- -`spring.profiles.active` and `spring.profiles.default` can only be used in non-profile specific documents. -This means they cannot be included in <> or <> by `spring.config.activate.on-profile`. +`spring.profiles.active` and `spring.profiles.default` can only be used in non-profile-specific documents. +This means they 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`. For example, the second document configuration is invalid: @@ -75,8 +75,8 @@ For example, when an application with the following properties is run, the commo - "local" ---- -WARNING: Similar to `spring.profiles.active`, `spring.profiles.include` can only be used in non-profile specific documents. -This means it cannot be included in <> or <> by `spring.config.activate.on-profile`. +WARNING: Similar to `spring.profiles.active`, `spring.profiles.include` can only be used in non-profile-specific documents. +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`. Profile groups, which are described in the <> can also be used to add active profiles if a given profile is active. @@ -104,6 +104,8 @@ For example, we can create a `production` group that consists of our `proddb` an Our application can now be started using `--spring.profiles.active=production` to activate the `production`, `proddb` and `prodmq` profiles in one hit. +WARNING: Similar to `spring.profiles.active` and `spring.profiles.include`, `spring.profiles.group` can only be used in non-profile-specific documents. +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`. [[features.profiles.programmatically-setting-profiles]]