无法使用 Maven 3.8.6 运行 Junit5 测试用例

问题描述 投票:0回答:1

考试地点:

module > src > test > java > TestRunner.java

为了调试,我已经编写了 testng 测试和 junit 5 测试。但只有,testng 测试正在执行。

mvn test -Dtest=TestRunner

我检查了其他帖子,他们建议使用 surefire 2.22.0 并将 jupiter 引擎指定为插件内的依赖项,但这没有帮助。

此外,

mvn dependency:tree
没有列出JUnit4依赖。

有什么建议吗?

以下是我目前的插件:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.22.0</version>
    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.8.2</version>
        </dependency>
    </dependencies>
</plugin>
java maven junit5 maven-surefire-plugin
1个回答
0
投票

测试现在在使用最新版本后运行:

  1. maven-surefire-plugin
    -
    3.0.0
  2. junit-jupiter-engine
    -
    5.9.1
© www.soinside.com 2019 - 2024. All rights reserved.