Hello. I’m trying to setup Sonarqube reporting for my repo. Code coverage on Sonarqube report is being reported as 0% while Jacoco report shows a coverage of 4%. Could you please help identify why this discrepancy exists?
Using Sonarqube Community Edition Version 8.9.9 (build 56886) and GitHub Enterprise Server 3.8.8
.github/workflows/pull_request.yaml file:
- name: Sonarqube scan
uses: actions/sonarqube-scan-action@v1.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
SONAR_HOST_URL: https://sonar.myHost.biz/
with:
args: >
-Dsonar.projectKey=${{myProjectKey}}
-Dsonar.sources=src/main/java
-Dsonar.inclusions=src/**/*
-Dsonar.coverage.inclusions=src/**/*
-Dsonar.coverage.exclusions=**/testdata/**,**/enums/*,**/exception/*,**/error/**
-Dsonar.java.binaries=./target/classes
-Dsonar.java.coveragePlugin=jacoco
-Dsonar.coverage.jacoco.xmlReportPaths=./target/site/jacoco/jacoco.xml