I love SonarCloud.io and I have 2 open source projects there (thank you!). Unfortunately, one of them does not seem to report any coverage despite having some unit tests running.
I must have stuffed up my pom.xml for Flatpack but I cannot see it and this is driving me nuts.
If you try to generate native JaCoCo report ( report goal of jacoco-maven-plugin ) , I’m pretty sure that this one will also be empty. To me seems that reason is that JaCoCo agent is not actually used during execution of tests and this is pretty common mistake described in JaCoCo documentation - see JaCoCo - jacoco:prepare-agent , which states:
If your project already defines VM arguments for test execution, be sure that they will include property defined by JaCoCo.
define “argLine” as a Maven property rather than as part of the configuration of maven-surefire-plugin:
<properties>
<argLine>-your -extra -arguments</argLine>
</properties>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- no argLine here -->
</configuration>
</plugin>