SpringBoot报错:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test

SpringBoot报错:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test

问题背景

在导入了jdbc和mysql依赖的时候,利用IDEA的maven install 命令,出现此错误

image-20220824173206097


问题分析

maven 在执行 install 时,单元测试部分的代码有问题,并没有全部通过。所以报错。


问题解决

方法1

删除jbdc的依赖

方法2

在pom.xml文件中导入,然后刷新maven即可。

<!-- 在buil下的plugins标签下 -->
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <!--跳过项目运行测试用例-->
        <skipTests>true</skipTests>
    </configuration>
</plugin>

如果还不行的话,忽略test模块后再进行maven install

image-20220824223938888


END

posted @ 2022-08-24 22:41  lyluoye  阅读(2662)  评论(0)    收藏  举报