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

港控/mmm° 2023-09-27 22:09 161阅读 0赞

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

在这里插入图片描述

文章目录

    • 报错问题
    • 解决方法
    • 声明

报错问题

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

  1. 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.
  2. Please refer to D:\m1\0613\mall-coupon\target\surefire-reports for the individual test results.
  3. 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部署

  1. <artifactId>dubbo-common</artifactId>
  2. <packaging>jar</packaging>
  3. <name>${
  4. project.artifactId}</name>
  5. <description>The common module of dubbo project</description>
  6. <properties>
  7. <skip_maven_deploy>true</skip_maven_deploy>
  8. </properties>

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

  1. <build>
  2. <plugins>
  3. <plugin>
  4. <groupId>org.apache.maven.plugins</groupId>
  5. <artifactId>maven-surefire-plugin</artifactId>
  6. <version>2.22.2</version>
  7. <configuration>
  8. <skipTests>true</skipTests>
  9. </configuration>
  10. </plugin>
  11. </plugins>
  12. </build>

声明

解决方法参考网络,如有侵权联系我删除

发表评论

表情:
评论列表 (有 0 条评论,161人围观)

还没有评论,来说两句吧...

相关阅读