解决:The import org.springframework.test cannot be resolved

解决:The import org.springframework.test cannot be resolved

这年头csdn上好多答案都是复制粘贴,找了好几个才找到正确解,还是Stack Overflow上比较权威。下面给出解决方案,并给出Stack Overflow上的链接,供大家参考。https://stackoverflow.com/questions/30513375/the-import-org-springframework-test-context-junit4-springjunit4classrunner-canno


解决方案:在maven中的pom.xml文件中添加代码所示的第二个依赖项spring-test即可,添加后右键项目->Maven->Update Project就完成。


		
			org.springframework
			spring-context
			4.3.17.RELEASE
		
		
  			org.springframework
  			spring-test
  			4.1.6.RELEASE
  		



你可能感兴趣的:(spring)