从网上找了个开源项目,导入IDEA之后,经过一系列改bug之后,存在报错:
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
可是已经启动了mysql,数据库url也检查了好几遍,还是不行,于是乎在网上找原因,找了好久看到一个博主的帖子最终解决了我的问题。太感谢了。
原因是application.yaml没有成功编译。
指路:https://blog.csdn.net/weixin_64855868/article/details/146684772?spm=1001.2014.3001.5501
这个项目里用的也是application.yaml
原项目pom.xml:

更改之后:

然后删掉了target文件,maven下面执行clean和compile,最后运行成功了。
浙公网安备 33010602011771号