From 3d4bd508df94bfef11071c16b6f2735dc2cb9a57 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-instrument/spring-instrument.gradle | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spring-instrument/spring-instrument.gradle b/spring-instrument/spring-instrument.gradle index 56289b9a6b57..54c5354559bf 100644 --- a/spring-instrument/spring-instrument.gradle +++ b/spring-instrument/spring-instrument.gradle @@ -1,3 +1,7 @@ +plugins { + id 'org.sonarqube' version '7.4.0.8496' +} + description = "Spring Instrument" jar { @@ -13,3 +17,13 @@ jar { nullability { requireExplicitNullMarking = false } + +// This module is analyzed as its own SonarQube project. +sonar { + properties { + property 'sonar.projectKey', 'org.springframework:spring-instrument' + property 'sonar.projectName', 'Spring Instrument' + property 'sonar.projectVersion', project.version + property 'sonar.sourceEncoding', 'UTF-8' + } +}