SonarQube version: 4.0.0.2929/Gradle 7.6.1
What are you trying to achieve: Scanning the “master” branch
For context: The sonarqube was running for each PR, but when the PR was merged , the master branch was never scanned.
Here’s the config for the sonar.gradle
sonarqube {
properties {
property "sonar.projectKey", "test-group-division-main-management"
property "sonar.organization", "testing123"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.coverage.jacoco.xmlReportPaths", new File("${buildDir}/reports/jacoco/test/*")
}
}
For the CI here’s the snippet to run the gradle
- ./gradlew sonarqube -Dorg.gradle.java.home=/usr/lib/jvm/java-17-amazon-corretto -Dsonar.login=$SONARCLOUD_KEY -Dsonar.pullrequest.branch=$head_ref -Dsonar.pullrequest.key=$pr_num -Dsonar.pullrequest.base=$base_ref -Dsonar.pullrequest.provider=github -x compileJava -x compileTestJava -x checkstyleMain -x checkstyleTest