Kotlin coverage analysis shows zero percent if using kotlinlang layout convention


  • SonarQube =
  • SonarKotlin = 1.5.0 (build 315)
  • Gradle Plugin = 2.8
  • Jacoco tool version = 0.8.4
  • Kotlin = 1.3.41
  • Gradle = 5.6.2

Error Observed = none appear on the build debug, however, the analysis shows zero coverage on completion.

Steps to reproduce = re-organise Kotlin source code as described in the Kotlinlang layout convention - https://kotlinlang.org/docs/reference/coding-conventions.html#source-code-organization
Specifically remove the root level package folders.

Tested on SonarQube before and after one of our developers made this change. Prior to the change coverage reports worked successfully. After the change they stopped working. I’ve tested on the specific commits before and after.

The Jacoco HTML report shows the correct coverage for both source layouts so I suspect this is a Sonar rather than Jacoco problem.

Workaround is to use standard Java source folder paths following package name conventions.