title: How to get test coverage percentage for java maven based program?
body: <p>I have a Java program based on maven and for that I need to know the test coverage percentage. For testing, I am using testng.</p>
  
  <p>I can already run the tests using command mvn test. All the tests are passing and I can see the report in surefire-reports/index.html. But I could not get the test coverage percentage that I need to supply for reporting.</p>
  
  <pre><code>mvn test
  </code></pre>
  
  <p>Expected result is Test Coverage Percentage is x%</p>