解决SpringBoot测试提示Failed to resolve org.junit.platform:junit-platform-launcher:1.5.2

解决SpringBoot测试提示Failed to resolve org.junit.platform:junit-platform-launcher:1.5.2

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
    <scope>test</scope>
    <exclusions>
        <exclusion>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
        </exclusion>
    </exclusions>
</dependency>

在这里插入图片描述

只需要添加:junit-platform-launcher依赖即可

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

发现其运行成功

在这里插入图片描述


版权声明:本文为weixin_46778896原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。