Maven打包报错Test failures

阅读量: 72 编辑

SpringBoot Maven 编译、打包报错 There are Test failures

Maven install 报错

There are Test failures.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date]

解决方法

pom.xml 文件的 plugins 节点中加上如下代码

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.5.6</version> <!-- 1.加上版本号 -->
            </plugin>
            
            <!-- 2.忽略Tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version> <!-- 3.版本号也可以不加 -->
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>

        </plugins>
</build>