Kotlin code coverage is imported from reports created by JaCoCo plugin. So, in order to import it in you need to make sure the report is correctly generated in XML format.
For this to work, you need to remove the
<forkMode>never</forkMode> configuration for maven-failsafe-plugin and maven-surefire-plugin. These options are not compatible with JaCoCo, as mentioned in the documentation. You’ll also need to run the JaCoCo
report goal, in order to create the coverage report in XML format.
Once this is done, you need to add the
sonar.coverage.jacoco.xmlReportPaths property when running the analysis, in order to tell the analyzer to read the coverage report file.
So, once you fix the configuration in your pom.xml, you should be able to run the analysis and import the coverage with a command simlar to this:
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify org.jacoco:jacoco-maven-plugin:report sonar:sonar [other sonar properties] -Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml