‘url‘ attribute is not specified and no embedded datasource could be configured已解决

遇到问题

在做微服务项目时遇到问题,截图如下

‘url‘ attribute is not specified and no embedded datasource could be configured已解决
项目尾声想添加一下根据数据库字段批量删除oss文件的功能,此时的项目一切正常已经可以上线运行了,在我添加完定时任务想做测试的时候报错了,错误信息是上面的,此时经过一个项目的沉淀,初步猜测问题出在pom文件缺少依赖,因为之前的数据库访问都是在别的服务里面,本服务主要是用于oss签名回传,可能没有引相关的依赖,根据猜测,稍作修改
‘url‘ attribute is not specified and no embedded datasource could be configured已解决
好吧第一次猜测不正确,然后剩下的就只有yml文件了
‘url‘ attribute is not specified and no embedded datasource could be configured已解决
ok,美丽的原谅色‘url‘ attribute is not specified and no embedded datasource could be configured已解决

总结

问题出现的原因:该服务没有调用过数据库,所以肯定缺访问数据库必要的东西:驱动,SpringBoot的最大一个好处就是自动配置,所以要盯的就两个位置,pom和yml,实在不会就跟别的服务对比一下,调用过数据库的多了些什么就加些什么