您的位置:首页 > 编程语言 > Java开发

spring boot Configuration Annotation Proessor not found in classpath

2017-08-09 16:21 621 查看
如下问题,见图片:

@ConfigurationProperties(prefix = "book",locations = "classpath:book.properties")

locations是红色字体,就是说ConfigurationProperties没有这个locations属性。








解决方案:

查看ConfigurationProperties的用法,或者ConfigurationProperties的location的用法。然后用这种方法思路解决问题时,发现网上有location过期的情况。

具体解决方案:

使用@PropertySource来指定自定义的资源目录代替使用@ConfigurationProperties中的locations

参考: http://www.jianshu.com/p/b71845c142d0

参考:百度搜索:@configurationproperties locations过期
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  spring
相关文章推荐