0
我想生成我的報告,所以我用maven-surefire-plugin
發送測試報告,以不同的目錄。使用maven-萬無一失,插件
這是我的pom.xml:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>test-reports</id>
<phase>install</phase>
<configuration>
<tasks>
<junitreport todir="./reports">
<fileset dir="./reports">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="./report/html"/>
</junitreport>
</tasks>
</configuration>
<goals>
<goal>test </goal>
</goals>
</execution>
</executions>
</plugin>
但是當我運行Maven的測試,我得到這個錯誤:
Tests run: 6, Failures: 2, Errors: 2, Skipped: 0
[INFO] --------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] --------------------------------------------------------------------
[INFO] Total time: 10.403s
[INFO] Finished at: Wed Oct 12 08:35:10 CEST 2011
[INFO] Final Memory: 17M/126M
[INFO] --------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire- plugin:2.10:test (default-test) on project jebouquine: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\Amira\workspace1\jebouquine\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
當我打開C:\Users\Amira\workspace1\jebouquine\target\surefire-reports
我發現repotrts但我想要他們在./reports
。
任何想法如何做到這一點?或者有什麼替代方案來生成我的測試報告?
感謝ü但我用您選擇的代碼,但我仍然有同樣的錯誤:我應該使用maven-的JUnit報告 - 插入?? –
我還以爲你想要reports',而不是'神火-reports'下'的報告。他們現在應該在正確的位置,不是嗎? –