title: Jacoco code coverage with Sonar and maven for integration tests in separate module
body: <p>I've configured my project with SonarQube and Jacoco for code coverage. Everything works well except one thing. I divided project in many maven sub modules:</p>
  
  <pre><code>project (pom.xml) - 
  |-moduleA (no pom here)
  |   |- it (pom.xml) - integration tests for "impl" module
  |   |- impl (pom.xml) - implementaion + Unit tests
  |-moduelB
  |   |- it (pom.xml) - integration tests for "impl" module
  |   |- impl (pom.xml) - implementaion + Unit tests
  |-moduleC ...
  </code></pre>
  
  <p>I start build using following command:</p>
  
  <pre><code>mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent -Dmaven.compiler.debug=true install sonar:sonar
  </code></pre>
  
  <p>The problem is that Jacoco can easily support Unit test coverage inside the same module (so in my case Unit Tests inside <code>impl</code> module) but cannot analyze coverage from <code>it</code> module which itself does not contain any implementation classes. It just contains integration tests for <code>impl</code> module. It's clear for me why it doesn't work. I'm getting such info in Jacoco logs:</p>
  
  <pre><code>No JaCoCo analysis of project coverage can be done since there is no class files.
  </code></pre>
  
  <p>After I've defined <code>sonar.java.binaries</code> property inside moduleA/it/pom.xml like this:</p>
  
  <pre><code>    &lt;properties&gt;
           &lt;sonar.java.binaries&gt;../impl/target/classes&lt;/sonar.java.binaries&gt;
      &lt;/properties&gt;
  </code></pre>
  
  <p>coverage analysis of <code>it</code> still fails, but message in Jacoco logs changes to:</p>
  
  <pre><code>[INFO] Analysing D:\project\moduleA\it\target\jacoco.exec
  [WARNING] Coverage information was not collected. Perhaps you forget to include debug information into compiled classes?
  </code></pre>
  
  <p>I must mention that <code>D:\project\moduleA\it\target\jacoco.exec</code> file exists. I also checked that compiled classes in <code>D:\project\moduleA\impl\target\classes</code> contain debug data (all lines, vars and source).</p>
  
  <p>I was trying with different paths inside <code>sonar.java.binaries</code> but result is always the same. I've tried:</p>
  
  <pre><code>../impl/target/classes
  ../../impl/target/classes
  ../../../impl/target/classes
  ../impl/target
  ...
  </code></pre>
  
  <p><strong>How can I configure Jacoco (Sonar) to allow it to find classes binaries in different maven sub module related to jacoco.exec file?</strong></p>