解决:The import org.springframework.test cannot be resolved
程序员文章站
2022-04-14 20:46:16
...
解决:The import org.springframework.test cannot be resolved
这年头csdn上好多答案都是复制粘贴,找了好几个才找到正确解,还是Stack Overflow上比较权威。下面给出解决方案,并给出Stack Overflow上的链接,供大家参考。https://*.com/questions/30513375/the-import-org-springframework-test-context-junit4-springjunit4classrunner-canno
解决方案:在maven中的pom.xml文件中添加代码所示的第二个依赖项spring-test即可,添加后右键项目->Maven->Update Project就完成。
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.17.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
</dependencies>
上一篇: MySQL安装
下一篇: Hibernate 实体类
推荐阅读
-
pycharm读取图片,提示ImportError: cannot import name imread解决方法
-
the import org.springframewok.test cannot be resolved
-
解决pyecharts importerror问题:cannot import name ‘bar’ from pyecharts
-
解决pyecharts导包报错 cannot import name 'Bar
-
python3-pyecharts可视化图形库的安装和使用,ImportError: cannot import name ‘Bar‘ from ‘pyecharts‘问题解决
-
jupyter notebook :ImportError: cannot import name 'constants' 解决方案
-
使用eclipse写JAVA出现xxx cannot be resolved to a type错误的解决方法详解
-
使用eclipse写JAVA出现xxx cannot be resolved to a type错误的解决方法详解
-
javaweb eclipse 出现 xxx cannot be resolved to a type 错误解决方法
-
Class cannot be resolved to a type解决办法