[问题解决]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 @ 2022-07-14 15:07  pinenuts  阅读(1884)  评论(0)    收藏  举报