From 9e318bad16098744aaa86ed35cedafd78affc542 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-oxm/spring-oxm.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spring-oxm/spring-oxm.gradle b/spring-oxm/spring-oxm.gradle index 6fce634f5e0a..39e6536c9922 100644 --- a/spring-oxm/spring-oxm.gradle +++ b/spring-oxm/spring-oxm.gradle @@ -2,6 +2,7 @@ import com.github.bjornvester.xjc.XjcTask plugins { id "com.github.bjornvester.xjc" + id 'org.sonarqube' version '7.4.0.8496' } description = "Spring Object/XML Marshalling" @@ -36,3 +37,13 @@ tasks.named("xjc", XjcTask).configure { // 2) Attach XJC output only to the test source sets via lazy providers. sourceSets.test.java.srcDir(tasks.named("xjc", XjcTask).flatMap { it.outputJavaDir }) sourceSets.test.resources.srcDir(tasks.named("xjc", XjcTask).flatMap { it.outputResourcesDir }) + +// This module is analyzed as its own SonarQube project. +sonar { + properties { + property 'sonar.projectKey', 'org.springframework:spring-oxm' + property 'sonar.projectName', 'Spring Object/XML Marshalling' + property 'sonar.projectVersion', project.version + property 'sonar.sourceEncoding', 'UTF-8' + } +}