📜  配置 Spring Boot 项目哪个更好——Properties 还是 YAML? - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:22.111000             🧑  作者: Mango

代码示例1
YAML offers many advantages over properties files:

More clarity and better readability
Perfect for hierarchical configuration data, which is also represented in a better, more readable format
Support for maps, lists and scalar types
Can include several profiles in the same file (since Spring Boot 2.4.0, this is possible for properties files too)
However, writing it can be a little difficult and error-prone due to its indentation rules.