且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 Eclipse 下使用 Maven 运行 JUnit 测试

更新时间:2021-09-26 05:57:11

您可以使用 Maven 运行 Junit 4.您只需要 pom 中的 Junit 4 依赖项.您还需要surefire插件来执行测试.

you can run Junit 4 with Maven. You just need the Junit 4 dependency in your pom. You also need the surefire plugin to execute the tests.

参见:http://maven.apache.org/plugins/maven-万无一失的插件/

提示:默认情况下,surefire 会查找带有 *Test.java 命名的文件来查找测试.

Hint: By default surefire looks for files with *Test.java naming to find tests.