Failed to resolve org.junit.platform:junit-platform-launcher:1.5.2 测试报错

找了很长时间,这是因为缺少依赖,我添加一个依赖也这样,添加两个也是这样,气炸
再找找原因,是因为我用的是手机的热点流量,手机还限速了,所以导致下载不下来
解决方法:
要添加4个依赖:
<!-- Junit依赖 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<!-- this is needed or IntelliJ gives junit.jar or junit-platform-launcher:1.3.2 not found errors -->
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
手动添加进去下载就好了
最后:帮到你点个赞呗!!
本文详细介绍了在使用JUnit进行测试时遇到的依赖问题及其解决方法。作者分享了因网络限速导致依赖下载失败的经历,并提供了需要添加的四个关键依赖项,帮助读者避免类似错误。

1919

被折叠的 条评论
为什么被折叠?



