jenkins编译项目报错Failed to execute goal org.apache.maven.plugins

错误信息

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project project_name: There are test failures.
[ERROR] 
[ERROR] Please refer to /root/.jenkins/workspace/manage/target/surefire-reports for the individual test results.

原因

此错误出现的原因一般是测试类和maven-surefire-plugin插件有冲突,也有可能是jar包的依赖问题,不影响我们项目的正常编译,在pom.xml中插入跳过测试的信息即可正常编译。

解决方法

在项目中的pom.xml中的<plugins>模块中插入下面的代码即可。

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

猜你喜欢

转载自blog.csdn.net/qq_36641456/article/details/89354077
今日推荐