maven导入了junit还是使用不了@Test注解

2022-10-31 09:07:48

maven导入了junit还是使用不了@Test注解

maven导入junit成功,但是就是用不了junit的注解

 <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13</version>
            <scope>test</scope>
 </dependency>

原因:scope配置了Junit可用的位置,test表示只能在src下的test文件夹下面才可以使用

解决办法:删除 scope标签及内容即可

  • 作者:发条橙1226
  • 原文链接:https://blog.csdn.net/qq_45054784/article/details/115453604
    更新时间:2022-10-31 09:07:48