title: How to use Sonar+JaCoCo to measure line coverage using integration tests (manual+automated)
body: <p>I am trying to do line coverage analysis of a java based application. Found many resources on the internet on how to use Sonar+JaCoCo plugin to get line coverage results, and it looks very promising. However, I couldn't get a full clarity on how to go about implementing this solution.</p>
  
  <p>More about my project:</p>
  
  <ol>
  <li><p>There is a service being called by a website. The service is java based, and is built using maven.</p></li>
  <li><p>There is also a selenium based test suite that is run on website (which makes calls to the above mentioned service at several instances). The test suite is built &amp; invoked by Ant.</p></li>
  <li><p>The code base for the service and the code base for the tests are at different locations on the same host.</p></li>
  <li><p>I need to generate coverage report for the service based on the integration test suite.</p></li>
  </ol>
  
  <p>The resources I went through are:</p>
  
  <ul>
  <li><a href="http://www.sonarsource.org/measure-coverage-by-integration-tests-with-sonar-updated/" rel="nofollow">http://www.sonarsource.org/measure-coverage-by-integration-tests-with-sonar-updated/</a></li>
  <li><a href="http://www.eclemma.org/jacoco/trunk/doc/ant.html" rel="nofollow">http://www.eclemma.org/jacoco/trunk/doc/ant.html</a></li>
  </ul>
  
  <p>Even after going through all of these, I am not sure where to put jacoco-agent.jar, whether to make jacoco a part of maven (service's build process) or ant (tests' build process), how to invoke jacoco agent, where to specify the source repository(service's code base) and test repository locations.</p>
  
  <p>I have tried blind permutations of all of the above, but either the maven build or the ant build starts failing as soon as I add jacoco tasks to them.</p>
  
  <p>Can someone please help me out in this? I need to understand the exact steps to follow to get it done.</p>