设置项目热部署的问题---Failed to auto-configure a DataSource

APPLICATION FAILED TO START

Description:

Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-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.


参考:https://www.jianshu.com/p/91376ce67c72



这是因为添加了数据库组件,所以autoconfig会去读取数据源配置,而我新建的项目还没有配置数据源,所以会导致异常出现。

即:@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})

你可能感兴趣的:(设置项目热部署的问题---Failed to auto-configure a DataSource)