Maven-Please refer to xxx\target\surefire-reports for the individual test results.

问题描述

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

Please refer to xxx\fruit\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.

原因

  • 这是因为测试代码时遇到错误,它会停止编译。

解决

https://www.cnblogs.com/qyf404/p/5013694.html

pom.xml添加下面代码:

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

其他

百度上有人这样说,但我编译不通过,其他人可以试试

  • pom.xml文件的Junit版本不对,或者其他原因(将junit依赖注释掉,编译通过)

猜你喜欢

转载自blog.csdn.net/weixin_43438052/article/details/114679394
今日推荐