解决maven install报错:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test

一、报错信息

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

Please refer to F:\project\code\wen-springboot\wen-boot\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.

报错原因 :

        maven项目在执行install时,报以上错误。原因:执行测试类失败,说明某个测试单元有问题。

二、解决方案

        1. 将maven的test插件禁用掉,操作如下:

解决maven install报错:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test_第1张图片

        2. 在pom中添加以下配置,如下:

            
                org.apache.maven.plugins
                maven-surefire-plugin
                
                    true
                
            

        3. 在测试类添加@Ignore注解忽略测试,如下:

解决maven install报错:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test_第2张图片

你可能感兴趣的:(后端异常总结,maven,spring,boot,java)