直接引入common模块启动项目报错
Description:
Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway.
Action:
Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
2.排除common包下的springweb依赖
写法如下
<dependency>
<groupId>com.mooc</groupId>
<artifactId>common</artifactId>
<exclusions>
<!-- Spring Cloud Gateway 项目中不能使用 spring-boot-starter-web 依赖-->
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</exclusion>
</exclusions>
</dependency>
报错
gateway依赖如下