File tree 1 file changed +20
-0
lines changed
spring-boot-project/spring-boot-docs/src/main/asciidoc
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -835,6 +835,26 @@ negated profiles may match.
835
835
YAML files cannot be loaded by using the `@PropertySource` annotation. So, in the case
836
836
that you need to load values that way, you need to use a properties file.
837
837
838
+ Using the multi YAML document syntax in profile-specific YAML files can lead to unexpected
839
+ behavior. For example, consider the following config in a file called `application-dev.yml`,
840
+ with the `dev` profile being active:
841
+
842
+ [source,yaml,indent=0]
843
+ ----
844
+ server:
845
+ port: 8000
846
+ ---
847
+ spring:
848
+ profiles: !test
849
+ security:
850
+ user:
851
+ password: weak
852
+ ----
853
+
854
+ In the example above, profile negation and profile expressions will not behave as expected.
855
+ We recommend that you don't combine profile-specific YAML files and multiple YAML documents and stick
856
+ to using only one of them.
857
+
838
858
839
859
840
860
[[boot-features-external-config-typesafe-configuration-properties]]
You can’t perform that action at this time.
0 commit comments