由于Spring Cloud的发展速度非常快,版本的更新非常频繁,同时成体系化的中文文档与教程又比较缺乏,所以很多初学者在搜索了网上的文章进行Spring Cloud的初次尝试时,经常会因为没有关注它的版本依赖关系而引发一些问题。比如平时被问最多的一个问题,在使用Feign的时候为什么报了如下错误:
完整报错:org.springframework.core.annotation.AnnotationConfigurationException: Attribute ‘value’ in annotation [org.springframework.cloud.netflix.feign.FeignClient] must be declared as an @AliasFor [serviceId], not [name].
原因就是版本不匹配,所以,我们在选择Spring Boot与Spring Cloud版本的时候,还是需要尽可能的按照Spring Cloud官方版本依赖关系来使用:
- Angel版本对应Spring Boot 1.2.x
- Brixton版本对应Spring Boot 1.3.x
- Camden版本对应Spring Boot 1.4.x
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。