0

Sonar 5 returns no code coverage data using the groovy plugin and using cobertura for code coverage. Maven also fails to return code coverage.

Configure a test instance with SonarQube 5.4 and the flowing plugins:

Build Breaker 1.1 Findbugs 3.3 Git 1.2 Groovy 1.3.1 Java 3.9 JavaScript 2.11 LDAP 1.5.1 PHP 2.8 Python 1.5 SVN 1.3 Web Analyze HTML 2.4 PMD 2.5

The old instance with Version 4.3.2 works? Does the cobertura plugin need to be installed, since it has been deprecated, or can the Java plug-in provide the correct support?

  • I use the cobertura plugin. – doelleri Sep 07 '16 at 22:19
  • I can see the coverage.xml file being generated by the local cobertura plugin, but it's failing when sending the information to Sonar. Log: `[INFO] Analyzing Cobertura report: target/test-reports/cobertura/coverage.xml` `[WARNING] File not found: JsLintConfig.groovy` Follows a list of WARNING “not found” lines for each file in the project. If we can find why the plugin is excluding these files from sending to Sonar then we can fix it – Sean Kennedy Oct 04 '16 at 21:43

1 Answers1

0

Indeed the import of Cobertura reports is no more supported out of the box. This requires to install the following dedicated community SonarQube Cobertura plugin : https://github.com/SonarQubeCommunity/sonar-cobertura/releases

  • Thanks Freddy. I'll install and test – Sean Kennedy Sep 09 '16 at 17:28
  • It appears cobertura code coverage is now working, but Maven still is not working for code coverage. Do we require a different pluging for maven? – Sean Kennedy Sep 13 '16 at 18:52
  • Just in case there would be a misunderstanding : you must generate the Coverage report with help of the Maven plugin for Coberbura (http://www.mojohaus.org/cobertura-maven-plugin/) and then you must import the content of this coverage report with help of the SonarQube Cobertura plugin (https://github.com/SonarQubeCommunity/sonar-cobertura) – Freddy - SonarSource Team Sep 15 '16 at 14:03