引入了junti包 无法使用@Test解决办法

2018年07月08日 10:46:34 灿夏 阅读数:4448

 版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/majishushu/article/details/80957437

今天自己做练习的时候发现junit的@Test注解无法用。发现原因是junit的@Test注解默认配置是只能在名称为test的目录下面使用,改一下配置就好了。如下图

(转)引入了junti包 无法使用@Test解决办法

去掉图中箭头标注的scope一行就行了。改完后的配置如下。

 
  1. <dependency>

  2. <groupId>junit</groupId>

  3. <artifactId>junit</artifactId>

  4. <version>4.7</version>

  5. <scope>test</scope>

  6. </dependency>

  7.  
  8. <dependency>

  9. <groupId>junit</groupId>

  10. <artifactId>junit</artifactId>

  11. <version>${junit.version}</version>

  12. </dependency>

(转)引入了junti包 无法使用@Test解决办法

相关文章:

  • 2022-01-21
  • 2021-07-14
  • 2021-05-02
  • 2021-10-08
  • 2022-12-23
  • 2023-03-20
  • 2021-10-01
  • 2021-11-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2021-05-19
  • 2021-05-31
  • 2022-12-23
相关资源
相似解决方案