- A+
所属分类:Spring Cloud Gateway
大家应该都知道,Spring Cloud Gateway与spring-boot-starter-web有冲突,一般情况下我们只需要把spring-boot-starter-web依赖去掉即可。
但是现在的情况是,Spring Cloud Gateway工程里引入了一个common包,common包里又加了spring-boot-starter-web依赖,所以无法直接删除依赖。解决方法如下:
在引入common包里加上exclusions来去掉spring-boot-starter-web依赖。
<dependency>
<groupId>com.xxx</groupId>
<artifactId>xxx-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</exclusion>
</exclusions>
</dependency>

2021年10月21日 上午10:43 沙发
感谢!!!!!!