FeignClient在春季启动2

FeignClient在春季启动2

本文介绍了FeignClient在春季启动2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Spring Boot 1.5 tio 2.0迁移并遇到问题:我将 spring-cloud-netflix-core 的版本从 1.3.4.RELEASE 更改为 2.0.1.RELEASE :

I am trying to migrate from spring boot 1.5 tio 2.0 and faced problem: I changed version of spring-cloud-netflix-core from 1.3.4.RELEASE to 2.0.1.RELEASE:

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-netflix-core</artifactId>
        <version>2.0.1.RELEASE</version>
    </dependency>

不幸的是,假库导入失败:

Unfortunately, feign library imports failed:

import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.feign.FeignAutoConfiguration;
import org.springframework.cloud.netflix.feign.FeignClient;

在新的2.0.1版本中没有库.feign.我应该怎么用呢? (由于与Spring Boot自动配置冲突,因此请勿离开旧的云版本)

There is no library .feign in new 2.0.1 version. What should I use instead? (connot leave old cloud version because of conflict with spring boot autoconfiguration)

推荐答案

2.x版本发布以来,Spring Cloud将netflix虚拟类移到了自己的项目中.

Since the 2.x release Spring Cloud moved the netflix feign classes to their own project.

https://github.com/spring-cloud/spring-cloud-openfeign

您需要使用正确的软件包更新重新导入

You need to update your re-import with the correct package

org.springframework.cloud.openfeign

这篇关于FeignClient在春季启动2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 17:46