打包maven项目时报错:

打包时报Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project eureka-server: There are test failures.
       for the individual test results.

\target\surefire-reports for the individual test results,无法正常打包,原因为单元测试不通过,maven打包就停止编译。

解决办法:

pom.xml中添加插件

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

更多推荐

\target\surefire-reports for the individual test results 问题解决