@ConfigurationProperties注解取消location属性

在spring boot 1.5 版本之前

在@ConfigurationProperties注释中有两个属性:
locations:指定配置文件的所在位置
prefix:指定配置文件中键名称的前缀

 

spring boot1.5以上版本@ConfigurationProperties取消location属性

替代方案是:

在配置类中采用@Component的方式注册为组件,然后使用@PropertySource来指定自定义的资源目录

 

posted @ 2017-11-10 14:59  贤言洛沐  阅读(857)  评论(0编辑  收藏  举报