最近在用 springcloud 搭建一个 web 应用时, 发现如果添加不要引入 spring-boot-starter-Web 包, 会导致 Gateway 启动抛出异常, 故使用
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-gateway</artifactId>
- </dependency>
就不需要添加
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-Web</artifactId>
- <!--<version>2.1.1.RELEASE</version>-->
- </dependency>
网上查了一下发现: Spring Cloud Gateway 是使用 netty+webflux 实现因此不需要再引入 Web 模块.
来源: http://www.bubuko.com/infodetail-2927653.html