在不需要配置数据源(例如MySQL数据库)的情况下,启动异常:
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
-------------------------------分割线----------------------------------------------------------------
解决办法如下:
在启动类加入注解:
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)