Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug‘ enabled.
2021-05-12 16:29:24.984 ERROR 17880 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
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).
Process finished with exit code 1
报错原因:未扫描到数据库配置文件,我是application.properties
解决方法:在pom里加上扫描语句,需要扫描什么后缀加什么
src/main/java
**/*.yml
**/*.properties
**/*.xml
false
src/main/resources
**/*.yml
**/*.properties
**/*.xml
false
原文:https://www.cnblogs.com/yiyuzi/p/14760459.html