PropertySource注解读取无法读取yaml文件
PropertySource注解读取无法读取yaml文件问题描述在使用ConfigurationProperties读取自定义的frame.yml文件时,使用PropertySource注解指定文件时发现没有将配置文件中的数据注入,但是当将配置放在默认的application.yml文件时发现读取成功。问题发生原因PropertySource注解默认采用的读取方式是DefaultPropertySourceFactory,而DefaultPropertySourceFactory无法读取Yaml文件
原创
2022-04-06 23:42:24 ·
1665 阅读 ·
0 评论