I am trying to generate code coverage for my GWT maven project.
It works with my jUnit test
mvn test jacoco:report
But when I run
mvn gwt:test jacoco:report
an empty report is generated.
How does I get code coverage when I'm running the 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>