File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
spring-boot-project/spring-boot-docs/src/main/asciidoc Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -836,6 +836,26 @@ negated profiles may match.
836
836
YAML files cannot be loaded by using the `@PropertySource` annotation. So, in the case
837
837
that you need to load values that way, you need to use a properties file.
838
838
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
+
839
859
840
860
841
861
[[boot-features-external-config-typesafe-configuration-properties]]
You can’t perform that action at this time.
0 commit comments