I am running the below command to scan the branch but I am just getting the 0% coverage. I read a lot of threads but was not able to understand this behavior
withSonarQubeEnv('SonarQube') {
sh "JAVA_HOME=/jdk-11 ./gradlew jacocoTestReport sonarqube -Dsonar.branch.name=${branchName}"
}
I have added this in my build.gradle
sonarqube {
properties {
property "sonar.host.url", "http://www.sonarqube.test.com"
property "sonar.projectKey", "com.test.app"
property "sonar.projectName", "Testapp"
property "sonar.exclusions", ["src/main/java/com/test/exclude/**"
]
property "sonar.jacoco.coveragePlugin", "jacoco"
}
}