[问题解决]idea junit5 failed to resolve org.junit.platform

问题 idea 无法运行junit5单元测试用例,错误提示:

Exception: intellij failed to resolve org.junit.platform:junit-platform-launcher:1.7.0

解决办法:

  • 方式一 : 添加pom依赖
<dependencies>
    <!-- ... -->
    <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-launcher</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.vintage</groupId>
        <artifactId>junit-vintage-engine</artifactId>
        <scope>test</scope>
    </dependency>
    <!-- ... -->
</dependencies>
  • 方式二 :检查代理配置(本人情况)
Intellij IDEA > Preferences... > Appearance & Behavior > System Settings > HTTP Proxy

Changed from  manual proxy to No Proxy settings

官方问题参考:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360003256319-Exception-intellij-failed-to-resolve-org-junit-platform-junit-platform-launcher-1-3-2

posted @   pinenuts  阅读(1473)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 终于写完轮子一部分:tcp代理 了,记录一下
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
点击右上角即可分享
微信分享提示