idea 运行项目出现Failed to configure a DataSource url attribute is not specified

idea 运行项目出现Failed to configure a DataSource:‘url’ attribute is not specified的最直接方法

BUG:Failed to configure a DataSource:‘url’ attribute is not specified
在这里插入图片描述
关键是查询工程项目的target文件夹下是否正常被编译出来
在这里插入图片描述
当时我的是:这样
在这里插入图片描述

说明他读取不到文件,查明后发现pom引入了错误的东西,如下:
在这里插入图片描述

总结:

看到此问题:

  1. 看pom文件有无错误
  2. 项目的resource有没有被标记,如下:
    在这里插入图片描述
  3. 项目结构问题

同样的
如果出现编译版本问题,即ctrl+alt+s和ctrl+alt+shift+s都不能解决版本冲突问题时,可以删掉target下的所有东西再编译。

猜你喜欢

转载自blog.csdn.net/weixin_41487978/article/details/106648938