From 83dfd27e35bed5964b6495df9053966d95e5a6fb Mon Sep 17 00:00:00 2001 From: Travis Date: Tue, 15 Sep 2026 16:44:57 +0000 Subject: [PATCH] Build: add a project-specific SonarQube scan Configures the org.sonarqube plugin so each spring-* sub-module is analyzed as its own SonarQube project keyed org.springframework:, rather than as a single aggregated scan of the whole build. Each module's configuration lives in its own build file so it can be reviewed and merged independently. Server URL and token are read from the SONAR_HOST_URL and SONAR_TOKEN environment variables rather than being hardcoded. --- spring-core/spring-core.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spring-core/spring-core.gradle b/spring-core/spring-core.gradle index 4c0df4f03d56..cf385e30ecdc 100644 --- a/spring-core/spring-core.gradle +++ b/spring-core/spring-core.gradle @@ -3,6 +3,7 @@ import org.springframework.build.shadow.ShadowSource plugins { id 'org.springframework.build.multiReleaseJar' + id 'org.sonarqube' version '7.4.0.8496' } description = "Spring Core" @@ -167,3 +168,13 @@ eclipse { } tasks['eclipse'].dependsOn(javapoetRepackJar, javapoetSourceJar, objenesisRepackJar, objenesisSourceJar) + +// This module is analyzed as its own SonarQube project. +sonar { + properties { + property 'sonar.projectKey', 'org.springframework:spring-core' + property 'sonar.projectName', 'Spring Core' + property 'sonar.projectVersion', project.version + property 'sonar.sourceEncoding', 'UTF-8' + } +}