完美解决Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2

已解决Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2

在这里插入图片描述

报错问题

粉丝群里面的一个小伙伴敲代码时发生了报错(当时他心里瞬间凉了一大截,跑来找我求助,然后顺利帮助他解决了,顺便记录一下希望可以帮助到更多遇到这个bug不会解决的小伙伴),报错信息如下:

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project gulimall-coupon: There are test failures.

Please refer to D:\m1\0613\mall-coupon\target\surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.

在这里插入图片描述

解决方法

解决方法如下

在这里插入图片描述
场景一:
如果是dubbo-3.0执行maven install失败,可以将skip_maven_deploy由false置为ture,跳过maven部署

    <artifactId>dubbo-common</artifactId>
    <packaging>jar</packaging>
    <name>${
    
    project.artifactId}</name>
    <description>The common module of dubbo project</description>
    <properties>
        <skip_maven_deploy>true</skip_maven_deploy>
    </properties>

在这里插入图片描述
场景二:
pom文件指定skipTests为true,跳过单测

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
        </plugins>

    </build>

福利

每周会送6本技术书籍包邮到家
由于博主时间精力有限,每天私信人数太多,没办法每个粉丝都及时回复
大家可以进社区裙或者添加博主微信
点击下方链接即可
http://t.csdn.cn/6kInJ

猜你喜欢

转载自blog.csdn.net/weixin_50843918/article/details/130693768
今日推荐