ChatGPT解决这个技术问题 Extra ChatGPT

Eclipse NoClassDefFoundError for LauncherFactory 未找到使用 JUnit 5 的测试

问题

每当我运行我的项目 JUnit 测试(使用 JUnit 5 和 Java 9 和 Eclipse Oxygen 1.a)时,我都会遇到 eclipse 找不到任何测试的问题。

说明

在运行配置下,eclipse甚至找不到用@Test注释的方法,而是只显示“(所有方法)”。下图希望能更好地了解我的设置:

https://i.stack.imgur.com/wVTPt.png

控制台输出:

java.lang.NoClassDefFoundError: org/junit/platform/launcher/core/LauncherFactory
    at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.<init>(JUnit5TestLoader.java:31)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.base/java.lang.Class.newInstance(Unknown Source)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createRawTestLoader(RemoteTestRunner.java:368)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createLoader(RemoteTestRunner.java:363)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.defaultInit(RemoteTestRunner.java:307)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.init(RemoteTestRunner.java:222)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Caused by: java.lang.ClassNotFoundException: org.junit.platform.launcher.core.LauncherFactory
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    ... 11 more

到目前为止我尝试了什么

我已经试过了

从构建路径中删除测试文件夹并再次添加它。

将鼠标悬停在使用 @Test 注释的方法上开始测试,然后单击“Run as JUnit Test”。

从 Buildpath 中删除 JUnit 并再次添加

重启日食

我还将项目整个项目从一台机器移动到另一台机器,并在那里使用提供的 eclipse 安装进行了尝试

重命名测试方法。

重新输入 @Test 注释

其中一些步骤can be found here,但最终问题仍然存在。

但是您是否尝试找出答案中所述的差异 -stackoverflow.com/questions/34413/…

J
JonathanDavidArndt

我通过右键单击测试并选择“运行配置”并将“测试运行器:”选择更改为“JUnit 4”来解决此问题,如下所示:

https://i.stack.imgur.com/oNPRd.png

我再次进行了测试,它成功了。


使用 JUnit5 时在运行配置中选择“JUnit4”很有趣。当我处理一个大项目时,我不会称这是一个我可以依赖的好解决方案。
我也发现这个解决方案很可疑,它甚至没有解释为什么会这样以及可能会冒什么风险。
如果这样做没有为您解决问题,请转到同一窗口上的类路径选项卡并将 JUnit 添加到引导库。
谢谢;选择 JUnit 4 解决了我的问题。目前,这是解决问题的最简单方法。
在我看来这种侵入性较小的解决方案,即无需修改源代码。
A
Andrii Karaivanskyi

我对 STS 3.9.1 有同样的问题。这似乎是一个 Eclipse 错误,但是,要修复此问题,您可以将测试依赖项 junit-platform-launcher 添加到您的项目 (https://mvnrepository.com/artifact/org.junit.platform/junit-platform-launcher)

这就是我为使用 gradle 的项目所做的:

dependencies {
    // other stuff here

    testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: "5.${junit5MinorVersion}"
    testCompile group: 'org.junit.platform', name: 'junit-platform-launcher', version: "1.${junit5MinorVersion}"
}

gradle.properties 文件:

junit5MinorVersion=1.0

如果您在使用 IntelliJ IDEA 时看到此异常,我相信同样适用。


如果使用 gradle 通常会转到 build.gradle。如果您使用的是 maven,它是 pom.xml。 maven 的格式虽然不同。
那为我修好了。谢谢!
这是要进入 的 pom.xml 片段: org.junit.jupiter junit-jupiter-engine 5.1.0 test org.junit.platform junit-platform-launcher 1.1.0 <范围>测试
仍然添加 junit-platform 1.1.0 对我不起作用。它显示相同的消息“没有使用 JUnit 5 的测试运行器找到测试”“
@PSatishPatro 添加上述内容后。您需要为该 Junit 测试用例运行配置,然后转到 Classpath 选项卡-> Advanced-> Add Library-> OK-> Junit-> Finish。然后继续运行它。这将在 Junit 执行期间添加库
a
armin.miedl

就我而言,问题出在我自己身上,没有像 Eclipse 这样的 IDE。我已经导入了 JUnit 4 Test 类。

所以不要导入这个:

import org.junit.Test  // JUnit 4

但是请导入那个:

import org.junit.jupiter.api.Test // JUnit 5

我在 JUnit 4 和 5 之间切换,因为当前项目使用的是 JUnit 5,但是当向 Hibernate 等报告错误时,我需要切换到 JUnit 4。我最终不小心混合了导入。 🤦‍♂️
这个答案需要更多的支持!
J
Jerry Carney

简单修复:(添加 JUnit 5 库)

指示:

右键单击项目 -> 构建路径 -> 配置构建路径

在弹出窗口中 -> 添加库 -> JUnit -> JUnit 5 -> 完成 -> 应用

您应该会看到 JUnit 5 库(及其 jar)已添加到您的项目中

右键单击项目 -> Maven -> 更新项目 -> 确定


GRADLE FIX:(添加 JUnit 5 库)说明:* 右键单击项目 -> 构建路径 -> 配置构建路径 * 在弹出窗口中 -> 添加库 -> JUnit -> JUnit 5 -> 完成 -> 应用 * 你应该会看到 JUnit 5 库(及其 jars)已添加到您的项目中 * 右键单击项目 -> Gradle -> 刷新 Gradle 项目 * 右键单击项目 -> 运行方式 -> Junit Test
这应该被接受,谢谢@JerryCarney
h
howlger

您遇到了已修复的 Eclipse bug 525948,它将在 2018 年 3 月 21 日即将发布的 Oxygen.3 (4.7.3) 版本中发布。

作为解决方法,将您的测试代码放在单独的项目中,并将被测项目添加到模块路径中,但不要将 module-info.java 添加到您的测试项目中。使用您的项目、类和模块命名,它应该如下所示:

https://i.stack.imgur.com/NBXME.png

另请参阅my video that shows Java 9 and JUnit 5 in Eclipse Oxygen.1a in action


@nullpointer 我的意思是创建一个非模块化的新 Java 项目(没有 module-info.java)。在 Eclipse 中,Java 项目只有一个输出文件夹,因此它只能包含一个或不包含 module-info.java。但是即使项目不是模块化的(没有 module-info.java),您也可以将模块添加到项目的模块路径中。
@ShadowDragon 这个 hack 的缺点是我们需要为测试类使用不同的包名,因此不能进行包私有测试
我刚刚安装了 Oxygen.3 (4.7.3) 并且问题仍然存在。
@chomp如果您有2018-09,即使症状看起来相似,这也是一个不同的问题。如果没有找到测试,这主要是由于类路径/模块路径不正确(项目 > 属性:Java 构建路径)。
@howlger 谢谢。升级到最新版本后,这个问题就消失了。再次感谢你的帮助 :)。
D
Developer Guy

到目前为止的答案并没有解决与不一定使用 Eclipse 的其他人共享代码的问题。这是一个提议。关键是使用maven profile来解决Eclipse Case。

它假设您在 pom 中定义了一个属性 junit5.version,例如:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <junit5.version>5.1.1</junit5.version>
</properties>

然后在 profiles 部分添加以下内容:

<profiles>
    <profile>
        <id>eclipse</id>
        <dependencies>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-launcher</artifactId>
            </dependency>
        </dependencies>
        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>org.junit.jupiter</groupId>
                    <artifactId>junit-jupiter-engine</artifactId>
                    <version>${junit5.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.junit.platform</groupId>
                    <artifactId>junit-platform-launcher</artifactId>
                    <version>1.1.1</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </dependencyManagement>
    </profile>
</profiles>

之后您要做的就是在本地 Eclipse 中选择配置文件:右键单击您的项目并选择 Maven > Select Maven Profiles...(或点击 Ctrl + Alt + P),然后检查我们刚刚创建的“eclipse”配置文件。

https://i.stack.imgur.com/9PFFU.png

这样你就完成了。您的 Eclipse 将按预期运行 Junit 5 测试,但您添加的配置不会污染其他构建或其他 IDE


h
hbhattac

使用 JUnit Jupiter (v.5.5.1) 添加这个 maven 依赖项解决了这个问题。

<dependency>
    <groupId>org.junit.platform</groupId>
    <artifactId>junit-platform-launcher</artifactId>
    <version>1.5.1</version>
    <scope>test</scope>
</dependency>

我有一个为 Spring Boot 2.x 创建的 JAR 项目,它引入了 JUnit 5。我添加了这个依赖项,它似乎已经修复了它。谢谢!
这个解决方案也解决了我在 STS IDE 中的问题。
M
Mike B

仅供参考,“没有使用 junit5 找到测试”的另一个原因是(无意或有意)将测试用例声明为“私有”:

// Example of test case that doesn't get included
@Test
private void testSomeMethod() {
}

他们需要公开。


T
T3rm1

没有一个解决方案有帮助:

问题是 Eclipse 2018-12 支持 JUnit 5.3.1。如果您使用之前的版本启动它,它将失败。

因此,请确保您至少使用 5.3.1。

5.4.0 也可以。

如果您的父 pom 是 Spring Boot,您需要确保(在依赖项管理中)将 junit-jupiter-api 设置为相同的版本。您不需要 junit-platform-runner 或 -launcher!


谢谢你的提示。我正在使用 2019-3,并添加了属性 <junit-jupiter.version>5.4.1</junit-jupiter.version> 以覆盖 Spring boot (2.1.3.RELEASE) 中使用的版本。
这是为我修复它的那个。我删除了 -launcher 依赖项,它开始工作。 (eclipse 2019-09 和junit 5.4.2)
这个解决方案也适用于我。但是,就我而言,我从 5.3.1 更改为 5.5.1,将 junit-platform-engine 更改为 1.5.1。
这为我修好了。在 Eclipse 2020-03 中,测试不是从 junit 版本 5.5.2 开始,而是从 5.6.0 开始。作为您答案的一般更新:可能需要至少使用 eclipse 使用的 junit 版本。
G
Gerold Broser

Andrii Karaivanskyi's answer 之后是 Maven POM 声明:

<properties>
    ...
    <junit-jupiter.version>5.2.0</junit-jupiter.version>
    <junit-platform.version>1.2.0</junit-platform.version>
    ...
</properties>

<dependencies>
    ...
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit-jupiter.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-launcher</artifactId>
        <version>${junit-platform.version}</version>
        <scope>test</scope>
    </dependency>
    ...
</dependencies>

更新

根据 Alexander Wessel 的评论,您可以使用 his answer 中所述的 org.junit:junit-bom 来提问 Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory


不要为 jupiter 和平台版本声明属性,use the BOM instead。基本上使用 scope=import type=pom 在dependencyManagement 标记中添加对BOM 的依赖项,然后在测试范围内将依赖项添加到junit-platform-launcher 和junit-jupiter-engine,在依赖项部分中不提供版本 . BOM 将始终确保您在类路径中只有一个版本的 JUnit Platform 和 Jupiter,并且各个版本都是预期的版本(例如 5.2.0 和 1.2.0)。
@AlexanderWessel 我没有 BOM。这只是一个示例摘录,无论它在哪里,都必须使用 Maven 声明依赖项。
不是你有(或者更确切地说你的项目有)BOM 本身。我在解释,通过导入 JUnit 5 提供的 BOM,您可以确保 Junit Jupiter 和 Junit Platform 版本兼容,并且您不需要在各个依赖项中声明版本,因此也不再需要声明版本特性。需要明确的是:您的示例确实可以正常工作。但是导入 JUnit BOM 更优雅一些(在我看来),并且在某些情况下更安全。
f
fatima fahmi

我实际上使用的是 spring-tool-suite-4-4.5.1,当我想运行一个测试类时我遇到了这个错误。解决方案是添加到库中的“java构建路径”、“junit5”

https://i.stack.imgur.com/4Vnjm.png


我一开始使用了这个解决方案并且它有效,然后我阅读了其他答案,我发现“正确”的答案是 @armin.miedl's。我从构建路径中删除了 JUnit 5 库,并将 Test 注释导入替换为正确的。
A
Alok Ranjan

我也遇到了同样的问题,你只需要添加库,Junit 库已经随 Eclipse 一起提供了,所以你只需要按照下面的操作

构建路径 > 配置构建路径 > 库 > 添加库 > JUnit > 下一步 > 完成

这个对我有用


它在日食中运行良好。版本:2020-06 (4.16.0) 内部版本号:20200615-1200
I
Ion Timotin

从一开始,错误消息就告诉您找不到类:NoClassDefFoundError 这意味着到 junit 的 PATH 是问题所在。

按右键单击项目文件夹并选择属性或选择项目文件夹并按组合 cmd + i。从列表“Java 构建路径”中选择。选择“Libraries”选项卡 如果将 JUnit 5(或 JUnit 4)添加到“Modulepath”,请选择“JUnit 5”并按 Remove。选择“类路径”,按“添加库...”。从打开的“添加库”窗口中,选择 JUnit,然后按下一步。选择您需要的 JUnit 库版本,然后按 Finish。

就这些。尝试再次运行测试。


a
atline

代替:

import org.junit.Test;

和:

import org.junit.jupiter.api.Test;

d
du-it

创建新的TestCase 后我遇到了同样的问题:Eclipse -> New -> JUnit Test Case。它创建一个没有访问级别修饰符的类。我可以通过在 class 关键字之前放一个 public 来解决这个问题。


类和方法都需要 public 关键字。 junit.org/junit4/javadoc/4.12/org/junit/Test.html
A
Arvind Katte

正如每个人都告知这是 IDE 错误,我在 EclipseSTS 中进行了尝试。在这两种情况下,它都失败了。

作为一种解决方法,我通过修改 pom.xml 文件来修复,如下所示。

我添加了这两个 Maven 依赖项 junit-jupiter-enginejunit-platform-launcher

pom.xml

<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine -->
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit-jupiter.version}</version>
        <scope>test</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.junit.platform/junit-platform launcher -->
    <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-launcher</artifactId>
        <version>${junit-platform.version}</version>
        <scope>test</scope>
    </dependency>
</dependencies>

另外请确保在属性标签中添加两个 Maven 依赖项的版本。

<properties>
    <java.version>1.8</java.version>
    <junit-jupiter.version>5.2.0</junit-jupiter.version>
    <junit-platform.version>1.2.0</junit-platform.version>
</properties>

添加 junit-platform-launcher 依赖项为我解决了这个问题。谢谢
Y
Y.halaoui

你应该知道 :

@Before from junit4 与 @Test 一起使用:“import org.junit.Test”

来自 Junit5 的 @BeforeEach 带有:“import org.junit.jupiter.api.Test”

所以请确保您使用的是来自同一版本的 Junit 的导入,否则我猜它不会工作。


B
Branislav Osadkovski

@Test 注解必须从 org.junit.jupiter.api.Test 导入,这样 Junit5 才能读取它。 Junit4 使用从 org.junit.Test 包导入的 @Test 注解。


m
mahe

使用 STS 3.9.1 我遇到了同样的问题。但是,目前我不需要任何新的 JUnit5 功能,所以我尝试强制使用旧版本。如果使用 maven,您可以在 pom.xml 中添加以下依赖项:

<dependency>
    <groupId>org.junit.platform</groupId>
    <artifactId>junit-platform-launcher</artifactId>
    <version>${junit.platform.version}</version>
    <scope>test</scope>
</dependency>

<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-engine</artifactId>
    <version>${junit.jupiter.version}</version>
    <scope>test</scope>
</dependency>

<dependency>
    <groupId>org.junit.vintage</groupId>
    <artifactId>junit-vintage-engine</artifactId>
    <version>${junit.vintage.version}</version>
    <scope>test</scope>
</dependency>

这对我有用(至少只要我不需要明确地需要 JUnit5)。


如果您使用 JUnit5,为什么要添加“org.junit.vintage”?它只是为了向后兼容(比如使用旧的 JUnit)AFAIK。
因为有了那个项目和 STS 3.9.1,我不能/没有使用 JUnit5,而是 JUnit4。
L
Lump

我正在使用 Eclipse 2019-09。

我必须将 junit-bom 版本更新到至少 5.4.0。我以前有 5.3.1,这导致了 OP 的相同症状。

我的配置现在是:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>5.5.2</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

另一种选择是将 5.4.0 添加到 pom 属性
R
Ravi Ranjan

您缺少带有组的 JUnit 5 平台启动器:'org.junit.platform',名称:'junit-platform-launcher'

只需添加您的 POM:

<dependency>
       <groupId>org.junit.platform</groupId>
       <artifactId>junit-platform-launcher</artifactId>
    </dependency>

G
Gerold Broser

由于无法将代码块发布到 comments,这是我在需要 JUnit 5 的项目中使用的 POM 模板。这允许在 Eclipse 中构建和“作为 JUnit 测试运行”,并使用普通 Maven 构建项目。

<project
    xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>group</groupId>
    <artifactId>project</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>project name</name>

    <dependencyManagement>
      <dependencies>
        <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>5.3.1</version>
        <type>pom</type>
        <scope>import</scope>
        </dependency>
      </dependencies>
    </dependencyManagement>

    <dependencies>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-launcher</artifactId>
        <scope>test</scope>
      </dependency>

      <dependency>
        <!-- only required when using parameterized tests -->
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-params</artifactId>
        <scope>test</scope>
      </dependency>
    </dependencies>
</project>

您可以看到,如果您想更新 JUnit,现在只需在一处更新版本。此外,平台版本号不需要出现在 POM 中的任何位置(在兼容版本中),它是通过 junit-bom 导入自动管理的。


R
RobC

您只能使用 junit-jupiter 而不是 junit-jupiter-apijunit-platform-launcherjunit-jupiter-engine 作为测试依赖项。

<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter</artifactId>
    <version>5.5.2</version>
    <scope>test</scope>
</dependency>

该解决方案适用于 JUnit 5.6.2、Java 11(和 eclipse 2020-03/4.15.0)
K
KBusc

我在用着:

Spring Tool Suite 4 版本:4.4.2.RELEASE 构建 ID:201911201053 Java 版本:1.8.0_191

并且显示的消息是 No tests found with test runner 'JUnit5'

对我有用的是下面的配置

    <properties>
        <java.version>1.8</java.version>
        <junit-jupiter.version>5.5.2</junit-jupiter.version>
        <junit-platform.version>1.5.2</junit-platform.version>
    </properties> 

    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit-jupiter.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-launcher</artifactId>
        <version>${junit-platform.version}</version>
        <scope>test</scope>
    </dependency>

T
Tenusha Guruge

您可能正在从 org.junit.Test 导入 @Test,这是一个 JUnit 4 注释。 Junit5 测试运行程序不会发现它。

Junit5 测试运行器将发现一个带有 org.junit.jupiter.api.Test 注释的测试

Import org.junit.Test throws error as "No Test found with Test Runner "JUnit 5"" 找到答案


S
Steephen

您应该确保您的测试用例函数是公共的而不是私有的,以便让 Test Runner 可以访问它。

@Test
private void testmethod(){}

@Test
public void testmethod(){}

H
Harpreet Singh

我在 Eclipse 版本 Oxygen.3a Release (4.7.3a) 中遇到了同样的错误。 Maven Dependencies 不匹配存在问题。为了解决,我已经用以下依赖项更新了我的 Pom.xml。

http://maven.apache.org/xsd/maven-4.0.0.xsd">4.0.0 com.netapp.junitnmactiopractice JunitAndMactioPractice 0.0.1-SNAPSHOT

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
    <junit.jupiter.version>5.1.1</junit.jupiter.version>
    <junit.platform.version>1.1.1</junit.platform.version>
</properties>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit.jupiter.version}</version>
    </dependency>
    <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-runner</artifactId>
        <version>${junit.platform.version}</version>
        <scope>test</scope>
    </dependency>
</dependencies>


您是否看过有关 junit-platform-runner: "Runner for executing tests and test suites on the JUnit Platform in a JUnit 4 environment." 的 JUnit 5 用户指南
A
Aegon

你应该改变

@Test
public static void testmethod(){}

@Test
public void testmethod(){}

@Test 不支持静态方法


D
Dineshotham Kumar Khambhammett

对我来说,我配置了构建路径以添加 JUnit 5 库并添加依赖项

     <dependency> 
        <groupId>org.junit.platform</groupId> 
        <artifactId>junit-platform-launcher</artifactId> 
        <version>1.1.0</version> 
        <scope>test</scope> 
     </dependency>

分开。


S
Srini Ramjee

我也遇到了 Eclipse(版本:2019-12 (4.14.0))的这个问题。该解决方案似乎要么使用 IntelliJ,要么使用 Maven 测试在 Eclipse 中运行此类测试。


关注公众号,不定期副业成功案例分享
关注公众号

不定期副业成功案例分享

领先一步获取最新的外包任务吗?

立即订阅