Tuesday, December 30, 2025

Spring boot project configuration file: applicaiton.properties vs application.yml

In Spring Boot, both application.properties and application.yml serve as external configuration files.


Application.properties uses a flat key-value format (e.g., server.port=8080), while application.yml uses a hierarchical, indentation-based structure that is more readable for complex configurations.


 If both files exist, Spring Boot loads both. application.properties takes precedence over application.yml, meaning values in the properties file will override those in the YAML file.

No comments:

Post a Comment