今天导入项目后遇到了这个问题:idea使用maven install报错maven Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project web_nanchang: There are test failures.

查询了下解决方法,以下解决方法转自博主:风撩起你的发梢
[https://blog.csdn.net/tokyo__hot/article/details/85554376]

出现上述错误有2种解决方式:

1.当前模块的test包下的某个test类没有test方法,可以加上@Ignore注解
2.在当前模块的pom.xml文件中加上如下内容即可解决

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

亲测有效!!!

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐