Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test)

打包maven项目的时候出现错误:

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

但是项目用maven编译没问题,之前测试也都过了。从上面描述可以确定是单元测试部分有问题,可能是测试类和maven-surefire-plugin:2.12.4:test (default-test)出现了冲突。抛出了java.lang.Exception: No runnable methods。


解决办法:在测试类上增加一个注解@Ignore,表示打包的时候忽略这个测试类,就能成功了。

猜你喜欢

转载自blog.csdn.net/wang907553141/article/details/80537335