Hi Community, I’ve faced issue on SonarQube 8.9 after sonar task finished I still see 0% test coverage on project. My configuration:
properties
sonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml
xml:
<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
<classpath>
<path path="${platformhome}/resources/ant/sonar/lib/sonarqube-ant-task-2.7.0.1612.jar"/>
</classpath>
</taskdef>
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath>
<path path="${platformhome}/resources/ant/sonar/lib/jacocoant.jar"/>
</classpath>
</taskdef>
//here is part of my sonar macrodef
<macrodef name="sonarcheck">
<sequential>
<sequential>
<jacoco:report>
<structure name="Test">
<group name="General">
<classfiles>
<fileset dir="${HYBRIS_BIN_DIR}">
<include name="**/*.class"/>
</fileset>
</classfiles>
<sourcefiles>
<fileset dir="${HYBRIS_BIN_DIR}">
<include name="**/*.java"/>
</fileset>
</sourcefiles>
</group>
</structure>
</jacoco:report>
</sequential>
<sonar:sonar/>
</sequential>
</macrodef>
sonar report works fine, but jacoco code coverage show 0%
before SonarQube 8.9 I just had one property : sonar.jacoco.reportPath=${HYBRIS_LOG_DIR}/jacoco/jacoco.exec
even without jacoco:report/ task in my sonar.xml file, and coverage was calculated and displayed in sonar. Does anybody have ideas what I could probably missed?