当idea出现以下错误时如何让测试类重新运行

运行spring-mybatis集成框架时,测试类运行出现以下错误,怎么解决?不能跳过或者删除测试类,因为我需要测试类来验证我的代码。
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project ch07-spring-mabatis: There are test failures.

Please refer to E:\文件夹1\spring-cource\ch07-spring-mabatis\target\surefire-reports for the individual test results.

原因就是单元测试不通过,maven打包就停止编译,所以你要么将不通过的代码删除,要么pom.xml中添加如下插件

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <testFailureIgnore>true</testFailureIgnore>
    </configuration>
</plugin>

示例如下

img

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632