Spring application.properties vs application.yml in Spring Boot: What's the difference?

Поділитися
Вставка
  • Опубліковано 30 вер 2024
  • Spring Boot now offers to file formats for developers to use to configure their applications and microservices: YAML and Properties.
    So, what's the difference between Spring application.properties and yaml/yml files? And why should you choose application.yml over an application.properties file in you code?
    Well, it comes down to support for the old PropertySource annotation to tell you the truth. And perhaps how hierarchical your data is. application.yml is great for hierarchical data, but it just doesn't work with the Spring PropertySource annotation, and that's a big drawback.
    Anyways, if you want to know the difference between Spring Boot application.properties an yaml files, check out this video and the manner in which YAML and properties files are compared.

КОМЕНТАРІ •