无法解析junit平台启动器1.6.3 IntelliJ [英] failed to resolve junit platform launcher 1.6.3 intellij

查看:18
本文介绍了无法解析junit平台启动器1.6.3 IntelliJ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在IntelliJ中运行测试,该测试以前在Spring Boot 2.2.x中运行。我最近升级到了春靴2.3.9。当我尝试从运行配置运行测试时,它没有运行测试并抛出错误:

‘无法解析junit Platform Launcher 1.6.3 IntelliJ’。

但是,如果我在CLI中运行测试,它工作正常。

推荐答案

原来,需要添加Junit5-Platform-Launcher依赖项才能在IntelliJ中运行Junit5测试。

https://youtrack.jetbrains.com/issue/IDEA-231927?_ga=2.5997872.2063517257.1613993298-1098513328.1597974168

https://junit.org/junit5/docs/current/user-guide/#running-tests-ide-intellij-idea

在pom.xml中显式添加此依赖项,将解决此问题。

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

这篇关于无法解析junit平台启动器1.6.3 IntelliJ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆