maven 使用错误

使用mvn test

mvn test -Dtest=测试包名.测试类名时

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project xxx-xxx: No tests were executed! (Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]

解决办法:按照提示: mvn test -Dtest=测试包名.测试类名 -DfailIfNoTests=false即可通过测试

原文地址:https://www.cnblogs.com/liuyifeng/p/6634970.html