我想爲我的GWT maven項目生成代碼覆蓋率。如何設置GWT,maven,jacoco的覆蓋範圍?
它與我的JUnit測試
mvn test jacoco:report
但是當我運行
mvn gwt:test jacoco:report
會生成空白報告。
我在運行gwt:tests時如何獲得代碼覆蓋率?
的pom.xml
GWT:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<module>${gwtModule}</module>
<gwtVersion>2.5.1</gwtVersion>
<runTarget>https://localhost:8443/dashboard/mainview.jsp</runTarget>
<noServer>true</noServer>
<sourcesOnPath>true</sourcesOnPath>
<hostedWebapp>${war.target}</hostedWebapp>
<mode>HtmlUnit</mode>
</configuration>
<executions>
<execution>
<configuration>
<extraJvmArgs>-Xmx512m</extraJvmArgs>
</configuration>
<goals>
<goal>compile</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
Jacoco:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.6.2.201302030002</version>
<configuration>
<destfile>${basedir}/target/coverage-reports/jacoco-unit.exec</destfile>
<datafile>${basedir}/target/coverage-reports/jacoco-unit.exec</datafile>
</configuration>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-site</id>
<phase>package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
您是否嘗試過JBoss的['jacoco-gwt-maven-plugin'](http://search.maven.org/#artifactdetails%7Corg.jboss.errai%7Cjacoco-gwt-maven-plugin%7C0.5.4。 201202141554%7Cmaven-插件)? – 2013-03-26 14:16:56
我嘗試過但我沒有得到它運行。 你有關於如何使用它的例子嗎? – kesse 2013-03-26 15:57:16
https://github.com/search?q=%22jacoco-gwt-maven-plugin%22&type=Code也許? – 2013-03-26 16:15:45