1.具体问题
2.原因分析
gateway 与 spring-boot-starter-web 冲突,
经过网上和官网查找原因是因为spring cloud gateway 是建立在spring boot 2.x 和 spring webflux基础上的既:gateway 本身已经包含了spring mvc 的功能,正与提示的一样和spring boot 的web starter冲突了
3.解决办法
可以尝试的方法
1.删除和排除web中的依赖
<dependency>
<groupId>com.example</groupId>
<artifactId>micro-service-cloud-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</exclusion>
</exclusions>
</dependency>
2.如果父类中含有spring-boot-starter-web引用则可以使用以下方法:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<scope>test</scope>
</dependency>