首先声明一下,此项目是copy我之前写的另一个项目,因为在项目基础上需要一些修改所以先copy一份,原项目启动时并不存在这个问题。
所以问题产生原因可推测一二。
报错提示:
***************************
APPLICATION FAILED TO START
***************************
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
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
改成:
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)