解决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插件禁用掉,操作如下:

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

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

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

猜你喜欢

转载自blog.csdn.net/weixin_48568302/article/details/125737586