Spring Cloud Gateway与spring-boot-starter-web冲突

  • 1
  • 浏览量:1,524 次
  • A+
所属分类:Spring Cloud Gateway

大家应该都知道,Spring Cloud Gatewayspring-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>

 

ZPY

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:1   其中:访客  1   博主  0

    • avatar czx 0

      感谢!!!!!!