title: How do I setup coverage with GWT, maven, jacoco?
body: <p>I am trying to generate code coverage for my GWT maven project.</p>
  
  <p>It works with my jUnit test </p>
  
  <pre><code>mvn test jacoco:report
  </code></pre>
  
  <p>But when I run </p>
  
  <pre><code>mvn gwt:test jacoco:report 
  </code></pre>
  
  <p>an empty report is generated.</p>
  
  <p>How does I get code coverage when I'm running the gwt:tests?</p>
  
  <p>Pom.xml</p>
  
  <p>GWT:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
      &lt;artifactId&gt;gwt-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.5.1&lt;/version&gt;
  &lt;configuration&gt;
      &lt;module&gt;${gwtModule}&lt;/module&gt;
      &lt;gwtVersion&gt;2.5.1&lt;/gwtVersion&gt;
      &lt;runTarget&gt;https://localhost:8443/dashboard/mainview.jsp&lt;/runTarget&gt;
      &lt;noServer&gt;true&lt;/noServer&gt;
      &lt;sourcesOnPath&gt;true&lt;/sourcesOnPath&gt;
      &lt;hostedWebapp&gt;${war.target}&lt;/hostedWebapp&gt;
      &lt;mode&gt;HtmlUnit&lt;/mode&gt;
  &lt;/configuration&gt;
  &lt;executions&gt;
      &lt;execution&gt;
          &lt;configuration&gt;
              &lt;extraJvmArgs&gt;-Xmx512m&lt;/extraJvmArgs&gt;
          &lt;/configuration&gt;
          &lt;goals&gt;
              &lt;goal&gt;compile&lt;/goal&gt;
              &lt;goal&gt;test&lt;/goal&gt;
          &lt;/goals&gt;
      &lt;/execution&gt;
  &lt;/executions&gt;
  </code></pre>
  
  <p></p>
  
  <p>Jacoco:</p>
  
  <pre><code>&lt;plugin&gt;
  &lt;groupId&gt;org.jacoco&lt;/groupId&gt;
  &lt;artifactId&gt;jacoco-maven-plugin&lt;/artifactId&gt;
  &lt;version&gt;0.6.2.201302030002&lt;/version&gt;
  &lt;configuration&gt;
      &lt;destfile&gt;${basedir}/target/coverage-reports/jacoco-unit.exec&lt;/destfile&gt;
      &lt;datafile&gt;${basedir}/target/coverage-reports/jacoco-unit.exec&lt;/datafile&gt;
  &lt;/configuration&gt;
  &lt;executions&gt;
      &lt;execution&gt;
          &lt;id&gt;jacoco-initialize&lt;/id&gt;
          &lt;goals&gt;
              &lt;goal&gt;prepare-agent&lt;/goal&gt;
          &lt;/goals&gt;
      &lt;/execution&gt;
      &lt;execution&gt;
          &lt;id&gt;jacoco-site&lt;/id&gt;
          &lt;phase&gt;package&lt;/phase&gt;
          &lt;goals&gt;
              &lt;goal&gt;report&lt;/goal&gt;
          &lt;/goals&gt;
      &lt;/execution&gt;
  &lt;/executions&gt;
  </code></pre>
  
  <p></p>