使用
由於給前端做分頁
在啟動消費者的時候遇到了這個問題
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

由於使用分頁依賴
<!--分頁依賴-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
</dependency>
導致需要配置數據源,但是我們消費者是不需要配置的
那么我們就需要在啟動類中增加注解禁止掉驅動數據源
添加exclude = DataSourceAutoConfiguration.class
@SpringBootApplication(scanBasePackages = "com.clx.myshop",exclude = DataSourceAutoConfiguration.class)
public class MyShopServiceUserConsumerApplication {
public static void main(String[] args) {
SpringApplication.run(MyShopServiceUserConsumerApplication.class, args);
}
}
