Skip to content

Commit e3fad4e

Browse files
committed
Merge branch '2.1.x'
2 parents 88f563a + dc31f61 commit e3fad4e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,26 @@ negated profiles may match.
836836
YAML files cannot be loaded by using the `@PropertySource` annotation. So, in the case
837837
that you need to load values that way, you need to use a properties file.
838838

839+
Using the multi YAML document syntax in profile-specific YAML files can lead to unexpected
840+
behavior. For example, consider the following config in a file called `application-dev.yml`,
841+
with the `dev` profile being active:
842+
843+
[source,yaml,indent=0]
844+
----
845+
server:
846+
port: 8000
847+
---
848+
spring:
849+
profiles: !test
850+
security:
851+
user:
852+
password: weak
853+
----
854+
855+
In the example above, profile negation and profile expressions will not behave as expected.
856+
We recommend that you don't combine profile-specific YAML files and multiple YAML documents and stick
857+
to using only one of them.
858+
839859

840860

841861
[[boot-features-external-config-typesafe-configuration-properties]]

0 commit comments

Comments
 (0)