maven install时报错 Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (

Posted jepson6669

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了maven install时报错 Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (相关的知识,希望对你有一定的参考价值。

今天在一个maven项目上执行maven install命令的时候一直报错,错误信息如下:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.167 s
[INFO] Finished at: 2018-05-27T23:11:47+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project e3-manager-service: There are test failures.
[ERROR] 
[ERROR] Please refer to E:\\develop\\eclipse-workspache\\ExclusiveWorkspache\\e3-manager\\e3-manager-service\\target\\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

解决上述问题有两种办法:

1 安装maven工程的时候跳过测试

clean install -DskipTests

这样就能够成功安装了:

 

 2 将跳过测试写入pom.xml文件

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

 

以上是关于maven install时报错 Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (的主要内容,如果未能解决你的问题,请参考以下文章

Maven多模块项目单独编译子模块项目时报错:Failed to execute goal on project

adb install 安装apk时报错Failure [INSTALL_FAILED_TEST_ONLY]解决方法

Mac电脑创建Vue项目时报错 错误内容:Error: command failed: npm install --loglevel error --legacy-peer-deps

在模拟器上运行Android项目时报错:DELETE_FAILED_INTERNAL_ERROR Error while Installing APKs

Maven install 报错: Failed to execute goalorg.apache.maven.plugins:maven-gpg-plugin:1.4:sign (sign-art

针对maven install 报错:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1 解决方案(示例