title: Sonar + JaCoCo - Code coverage for both Java and Groovy
body: <p>I'm having some problems to make Sonar display code coverage for tests written in both Java and Groovy. I have a Maven multi-module project where a module can be exemplified like this:</p>
  
  <pre><code>firstServer
    src/test/groovy
      package1
        GroovyTest1.groovy
        GroovyTest2.groovy
    src/test/java
      package2
        JavaTest1.java
        JavaTest2.java
  </code></pre>
  
  <p>The <strong>pom.xml</strong> for firstServer looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  ...
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.jacoco&lt;/groupId&gt;
              &lt;artifactId&gt;jacoco-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;0.7.7.201606060606&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;destFile&gt;${sonar.jacoco.reportPath}&lt;/destFile&gt;
                  &lt;append&gt;true&lt;/append&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;agent&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;prepare-agent&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
          ...
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>My Sonar properties are in the parent <strong>pom.xml:</strong></p>
  
  <pre><code>&lt;properties&gt;
      &lt;sonar.java.coveragePlugin&gt;jacoco&lt;/sonar.java.coveragePlugin&gt;
      &lt;sonar.dynamicAnalysis&gt;reuseReports&lt;/sonar.dynamicAnalysis&gt;
      &lt;sonar.jacoco.reportPath&gt;${project.basedir}/../target/jacoco.exec&lt;/sonar.jacoco.reportPath&gt;
  &lt;/properties&gt;
  </code></pre>
  
  <p>When I run the command <strong>mvn package sonar:sonar</strong> and visit SonarQube to see the results, the code coverage only takes java classes into account. I can't see any groovy classes among my unit tests even though I have many of them. I guess that I'm missing something in my POM files but I don't know what. I have read that it is possible to have a mix of Groovy and Java test classes when using Sonar and JaCoCo. My question is simply, what am I missing?</p>
  
  <p>Thanks in advance!</p>