问题
想要把一些复杂的配置项放在yml文件中,又不像全部放在application.yml中。
一开始使用propertySource 一直无法加载yml。原来propertySource 只能读取properties文件。
考虑到yml 可读性要强一些,还是希望使用yaml
解决方法:
https://www.baeldung.com/spring-boot-load-multiple-yaml-configuration-files
- 使用多个application-profile.yml
- 自定义propertySource的解析,支持yml文件。
网友评论