Eclipse Juno并安装Maven surefire插件

时间:2012-08-09 13:47:29

标签: eclipse maven

我正在学习Maven,我有一个简单的pom示例项目。 我想要添加surefire插件,以便我可以运行junit测试。 我假设我可以用Eclipse以某种方式添加插件,或者我是否需要使用命令行?

2 个答案:

答案 0 :(得分:3)

似乎@ Ajay George提供的答案是最好的,但是如果您错过了带有红色和绿色条的漂亮JUnit GUI,请参阅@ this comment thSoft

  

如果您在Eclipse的JUnit视图中可以查看Surefire的测试报告   打开target / surefire-reports中的XML文件。

答案 1 :(得分:2)

安装包含surefire插件的m2eclipse

下面的屏幕截图包含“运行方式” - > “Maven Test”选项将调用surefire插件。

Screenshot of m2eclipse Run As option