valluru saiteja
11/09/2025, 10:22 AMplugins {
// Declare the SonarQube plugin here but don't apply it automatically.
// This makes the plugin available to all subprojects using the same version,
// while allowing us to selectively apply it only to relevant modules (e.g., exclude 'bom' or root).
id 'org.sonarqube' version '7.0.1.6134' apply false
}
subprojects {
if (project.name != 'bom') {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'jacoco'
apply plugin: 'org.sonarqube'
afterEvaluate {
if (project.name == "sai" || project.name == "sai1" || project.name == "sai2") {
// Skip SonarQube analysis for these projects
sonar {
skipProject = true
}
} else {
// Apply SonarQube properties for other projects
sonar {
properties {
property "sonar.host.url", "<https://sonar.sai.com>"
property "sonar.projectKey", "sai.eas.app-gradle"
property "sonar.projectName", "sai-eas.app-gradle"
property "sonar.token", "sai_faefefibbvkbrkbrbkbbvrkb123456"
property "sonar.sources", "src/main/java"
property "sonar.tests", "src/test/java"
// Add other required properties here
}
}
}
}
}
}
While running in local at first it analyzed and publish the reports to sonarqube server(Not for all componenets just 1 or 2 ). inside modules there will be submodules. If a particular module doesn't contain say for example src/tst/java the sonarscan should skip and go for next module ...in my case it was failing right after that stage. I was using the command "gradle sonar --info"Vampire
11/09/2025, 11:32 PM