Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Install the Emma plugin through the Update Center or download it into the SONAR_HOME/extensions/plugins directory
  2. Restart the Sonar server

Usage

To make the default code coverage tool:

  1. Log in as an administrator
  2. Go to Settings > Configuration > General Settings > Java
  3. Set the 'sonar.java.coveragePlugin' property to 'emma'

To activate Emma on some projects:

  1. Add the 'sonar.java.coveragePlugin=emma' when executing the maven plugin. This can be set in pom.xml or in command line.
  2. Or use the 'reuseReports' mode:

    Code Block
    titlereuseReports mode
    languagehtml/xml
    <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
    <!-- Path to the directory with .ec and .em Emma files -->
    <sonar.emma.reportPath>emmaDir</sonar.emma.reportPath> 

     

     

See the Code Coverage by Unit Tests for Java Project tutorial.

Info
titleSupported report formats

Note that only reports of offline instrumentation are currently supported (*.ec and *.em files). XML or HTML formats are not.

See also the Code Coverage by Unit Tests tutorial.

Known Limitations

Branch coverage is not calculated as such notion does not exist in Emma.

...