Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在学习 Maven,并且我有一个带有简单 pom 的示例项目。我也想添加surefire插件,这样我就可以运行junit测试了。我假设我可以以某种方式使用 Eclipse 添加插件,还是需要使用命令行?
@Ajay George提供的答案似乎是最好的,但如果您缺少带有红色和绿色条的漂亮 JUnit GUI,请参阅@thSoft 的评论:
如果您在 target/surefire-reports 中打开 XML 文件,您可以在 Eclipse 的 JUnit 视图中查看 Surefire 的测试报告。
安装包含 surefire 插件的m2eclipse 。
下面给出的屏幕截图包含“运行方式”->“Maven 测试”选项,它将调用 surefire 插件。