In my project i'm currently using application.yml
for configuration. Spring Initializr generate application.properties
? What are the Pro/Cons for each one?
Well, they are just different data formats. Which one's nicer and easier to read? That's obviously subjective. Here's a useful blog post.
As far as spring-boot
configuration is concerned, note that there's only one documented shortcoming of using YAML
. Per the documentation:
YAML files can’t be loaded via the
@PropertySource
annotation. So in the case that you need to load values that way, you need to use a properties file.