I need to generate jacoco report and publish it in sonar for the junit test cases in hybris project. When I publish the jacoco report in sonar, the code coverage includes OOB classes also.
I have excluded the unwanted extensions using sonar.excludedExtensions=xx,yy I need to exclude some directories inside my custom extensions.
I tried using sonar.jacoco.excludes=x.y.z.* and sonar.exclusions=xx/** but nothing works.
How can I exclude classes or directories during jacoco analysis. I have OOB acc-ant-sonar.xml file as below in hybris which drives the jacoco analysis.
<project name="acc.ant.sonar" xmlns:jacoco="antlib:org.jacoco.ant">
<taskdef uri="antlib:org.jacoco.ant" resource="path/antlib.xml">
<classpath path="xx.jar"/>
</taskdef>
<target name="jacocoalltests" description="runs allstests with jacoco attached">
<jacoco:agent property="agentvmparam"
append="true"
output="file"
destfile="output_path/jacoco.exec"
/>
<property name="testclasses.extensions" value="${extname}"/>
<ant dir="${platformhome}" target="alltests" inheritrefs="false">
<property name="standalone.javaoptions" value="${agentvmparam} ${standalone.javaoptions}"/>
</ant>
</target>
</project>