排除Junit4测试依赖项

时间:2019-02-11 17:02:47

标签: maven intellij-idea junit5

我有一个较旧的父pom(我不能取消继承),带有以下代码段

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

我的孩子项目是一个全新的项目,我只想使用Junit5 。但是我认为由于继承,当包含vintage时,maven surefire插件2.22会同时运行Junit4和Junit 5测试,并且仅在不存在Vintage工件时才运行Junit5。

Intellij很高兴允许您同时编写Junit4(org.junit.Test)和Junit5(org.jupiter.api.Test)

有什么方法可以完全排除Junit4(即使在父级中)?对于新项目,只需编写Junit 5测试就更有意义。

如果有任何办法至少可以暗示Intellij不使用Junit4会有用吗?

0 个答案:

没有答案
相关问题