Test类添加后 报错:程序包org.junit不存在解决


 

<dependency> <groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
 <!-- 作用域范围为test -->
 <scope>test</scope> </dependency>


将<scope>test</scope>注释掉即可

如下:
<dependency>
   <groupId>junit</groupId>
   <artifactId>junit</artifactId>
   <version>4.7</version>
</dependency>

 

原因:scope的作用范围问题,注释掉即可

为人:谦逊、激情、博学、审问、慎思、明辨、 笃行
学问:纸上得来终觉浅,绝知此事要躬行
为事:工欲善其事,必先利其器。
态度:道阻且长,行则将至;行而不辍,未来可期
转载请标注出处!
原文地址:https://www.cnblogs.com/ios9/p/14802420.html