I have a standalone Jenkins job to run Sonar on our codebase, which works fine, but I am consistently getting code coverage of zero despite the fact that the post-processing job correctly displays the code coverage in Jenkins. I think the issue is with Sonar not picking up the exec files correctly, as I am receiving this in the Jenkins logs:
INFO: Analysing D:\Data\CCS\Jenkins\jobs\Sonar Scan\workspace\ccs-core\target\jacoco.exec
INFO: Analysing D:\Data\CCS\Jenkins\jobs\Sonar Scan\workspace\ccs-core-common\target\jacoco.exec
INFO: Analysing D:\Data\CCS\Jenkins\jobs\Sonar Scan\workspace\ccs-core-client\target\jacoco.exec
INFO: No JaCoCo analysis of project coverage can be done since there is no class files.
Despite the fact that I can see that the files are in that location after the job has completed.
I have two steps in the build, the first is to run Jacoco via mvn:
clean org.jacoco:jacoco-maven-plugin:prepare-agent install -Dmaven.test.failure.ignore=true
the second just uses the Sonar plugin to generate the report. Then there is the post-processing report that generates the Jacoco report in Jenkins.
Could some helpful soul point me to what I might be missing?