title: SonarQube Jacoco offline instrumentation shows 0% coverage in Maven Multi Module Project
body: <p>I am using Jacoco offline instrumentation as I have used PowerMockito for my test cases. Mine is Maven Multi Module Project. 
  I am using PowerMockito 1.65
  My SonarQube version is  6.7</p>
  
  <p>JaCoCo generates HTML files in every module, But in SonarQube it is showing 0%</p>
  
  <p>My parent pom.xml</p>
  
  <pre><code>&lt;properties&gt;
      &lt;sonar.version&gt;6.7&lt;/sonar.version&gt;
      &lt;sonar-java.version&gt;4.2&lt;/sonar-java.version&gt;
      &lt;sonar.core.codeCoveragePlugin&gt;jacoco&lt;/sonar.core.codeCoveragePlugin&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.sonarsource.sonarqube&lt;/groupId&gt;
          &lt;artifactId&gt;sonar-plugin-api&lt;/artifactId&gt;
          &lt;version&gt;${sonar.version}&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.sonarsource.java&lt;/groupId&gt;
          &lt;artifactId&gt;sonar-java-plugin&lt;/artifactId&gt;
          &lt;version&gt;5.0.1.12818&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.12&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.jacoco&lt;/groupId&gt;
          &lt;artifactId&gt;org.jacoco.agent&lt;/artifactId&gt;
          &lt;classifier&gt;runtime&lt;/classifier&gt;
  
          &lt;version&gt;0.7.9&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.sonarsource.java&lt;/groupId&gt;
          &lt;artifactId&gt;sonar-jacoco-listeners&lt;/artifactId&gt;
          &lt;version&gt;4.9.0.9858&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
  
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.20&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;systemPropertyVariables&gt;
                      &lt;jacoco-agent.destfile&gt;${project.build.directory}/coverage.exec&lt;/jacoco-agent.destfile&gt;
                  &lt;/systemPropertyVariables&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.sonarsource.scanner.maven&lt;/groupId&gt;
              &lt;artifactId&gt;sonar-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.6.1&lt;/version&gt;
          &lt;/plugin&gt;
  
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;sonar-coverage&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
          &lt;/activation&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;configuration&gt;
                          &lt;append&gt;true&lt;/append&gt;
                      &lt;/configuration&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;id&gt;default-instrument&lt;/id&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;instrument&lt;/goal&gt;
                              &lt;/goals&gt;
                          &lt;/execution&gt;
                          &lt;execution&gt;
                              &lt;id&gt;default-restore-instrumented-classes&lt;/id&gt;
  
                              &lt;goals&gt;
                                  &lt;goal&gt;restore-instrumented-classes&lt;/goal&gt;
                              &lt;/goals&gt;
                          &lt;/execution&gt;
                          &lt;execution&gt;
                              &lt;id&gt;default-report&lt;/id&gt;
                              &lt;phase&gt;prepare-package&lt;/phase&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;report&lt;/goal&gt;
  
                              &lt;/goals&gt;
                              &lt;configuration&gt;
                                  &lt;dataFile&gt;${project.build.directory}/coverage.exec&lt;/dataFile&gt;
                              &lt;/configuration&gt;
                          &lt;/execution&gt;
  
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/build&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  &lt;modules&gt;
      &lt;module&gt;module1&lt;/module&gt;
      &lt;module&gt;module2&lt;/module&gt;
  &lt;/modules&gt;
  </code></pre>
  
  <p>
  run with command <code>clean install test sonar:sonar</code></p>
  
  <p>JaCoCo Report 
  <a href="https://i.stack.imgur.com/2qkRD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2qkRD.png" alt="enter image description here"></a></p>
  
  <p>SonarQube Report
  <a href="https://i.stack.imgur.com/DFjpd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DFjpd.png" alt="enter image description here"></a></p>