【Debugger】解决springboot报错Failed to resolve org.junit.platform:junit-platform-launcher:1.x.x的两种解决方案

在使用SpringBoot测试时如果出现Failed to resolve org.junit.platform:junit-platform-launcher:1.x.x这样的问题,最主要的问题是IntelliJ IDEA版本和junit版本不适配问题,所以最根本的解决方法是将IntelliJ IDEA的版本升级到2020.x.x以上的版本,其次是直接在项目的pom.xml文件中添加如下依赖:

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

参考博客:

  1. Failed to resolve org.junit.platform:junit-platform-launcher:1.5.2
  2. 解决办法:IntelliJ IDEA运行Junit5错误 : Exception in thread “main” java.lang.NoSuchMethodError: org.junit.pla

猜你喜欢

转载自blog.csdn.net/Cap220590/article/details/107479651