Skip to content

Add note concerning application yml and properties file precedence #25300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ 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-profile-specific,Profile-specific application properties>> outside of your packaged jar (`application-\{profile}.properties` and YAML variants).

NOTE: If you have both `application.yml` and `application.properties` on the same level, the `application.properties` will take precedence.

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]
Expand Down