title: Jacoco SonarQube Integration
body: <p>I've spent a good couple of days trying to get SonarQube to display unit test code coverage from the Maven Jacoco plugin.</p>
  
  <p>The error message I am stuck on is </p>
  
  <pre><code>[INFO] Analysing .../target/jacoco.exec
  [WARNING] Coverage information was not collected. Perhaps you forget to include debug information into compiled classes?
  </code></pre>
  
  <p>The report under target/site/jacoco/index.html generates as expected and contains line highlighting and line numbers.  I have read that if no debug information is included in the compiled classes then the highlighting and line numbers will not show in this report.</p>
  
  <p>I have read Maven includes debug information by default, however, just in case I included the following configuration in my projects maven-compiler-plugin setup</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;debug&gt;true&lt;/debug&gt;
      &lt;debuglevel&gt;lines,vars,source&lt;/debuglevel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I have the following properties in my settings.xml (host and login left out on purpose)</p>
  
  <pre><code>&lt;properties&gt;
      &lt;sonar.host.url&gt;&lt;/sonar.host.url&gt;
      &lt;sonar.login&gt;&lt;/sonar.login&gt;
      &lt;sonar.ws.timeout&gt;300&lt;/sonar.ws.timeout&gt;
  &lt;/properties&gt;
  </code></pre>
  
  <p>I have the following configuration of my Jacoco plugin. </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.7.7.201606060606&lt;/version&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;goals&gt;
                  &lt;goal&gt;prepare-agent&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
          &lt;execution&gt;
              &lt;id&gt;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;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>My jacoco.exec is in the default location of target/jacoco.exec and is found correctly by SonarQube.</p>
  
  <p>Relevant versions</p>
  
  <p>Maven 3.2.2</p>
  
  <p>Maven Compiler 3.5.1</p>
  
  <p>Maven Surefire 2.19.1</p>
  
  <p>Java 1.8.0_11</p>
  
  <p>SonarQube Server 5.6</p>
  
  <p>Jacoco Maven Plugin 0.7.7.201606060606</p>
  
  <p>Mac OS X 10.10.5</p>
  
  <p>Thanks in advance for the help!</p>
  
  <p>---- EDIT ----</p>
  
  <p>I am running the following maven commands</p>
  
  <p><code>mvn clean package</code></p>
  
  <p><code>mvn sonar:sonar</code></p>