Commit f2f51062 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #25300 from robert-smith-911

* pr/25300:
  Polish "Document precedence between properties and yaml"
  Document precedence between properties and yaml

Closes gh-25300
parents 06b26408 63cca9b8
...@@ -522,6 +522,9 @@ Config data files are considered in the following order: ...@@ -522,6 +522,9 @@ Config data files are considered in the following order:
. <<boot-features-external-config-files,Application properties>> outside of your packaged jar (`application.properties` and YAML variants). . <<boot-features-external-config-files,Application properties>> outside of your packaged jar (`application.properties` and YAML variants).
. <<boot-features-external-config-files-profile-specific,Profile-specific application properties>> outside of your packaged jar (`application-\{profile}.properties` and YAML variants). . <<boot-features-external-config-files-profile-specific,Profile-specific application properties>> outside of your packaged jar (`application-\{profile}.properties` and YAML variants).
NOTE: It is recommended to stick with one format for your entire application.
If you have configuration files with both `.properties` and `.yml` format in the same location, `.properties` takes precedence.
To provide a concrete example, suppose you develop a `@Component` that uses a `name` property, as shown in the following example: To provide a concrete example, suppose you develop a `@Component` that uses a `name` property, as shown in the following example:
[source,java,indent=0] [source,java,indent=0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment