Skip to content

Build: add a project-specific SonarQube scan for each sub-module - #1

Closed
trly wants to merge 1 commit into
mainfrom
sonarqube-per-module-scans-4860776c-28c6-4cbd-9347-d1fe28aa7678
Closed

trly wants to merge 1 commit into
mainfrom
sonarqube-per-module-scans-4860776c-28c6-4cbd-9347-d1fe28aa7678

Conversation

@trly

@trly trly commented Sep 15, 2026

Copy link
Copy Markdown

Introduces a separate, project-specific SonarQube analysis for every spring-* sub-module, rather than one aggregated scan of the whole build.

What changed

  • Root build.gradle — declares the org.sonarqube plugin (7.4.0.8496, the first line supporting Gradle 9) with apply false, and applies the new convention script to moduleProjects.
  • gradle/sonar.gradle (new) — applies the SonarQube plugin per module so each one is its own standalone SonarQube project, with sonar.projectKey of org.springframework:<module>, a project name derived from the module description, and the module's version. The plugin is deliberately not applied at the root, which would collapse everything into a single aggregated analysis.
  • .github/workflows/sonar.yml (new) — a matrix workflow with one job per sub-module, so each module's scan reports independently.

Scope

Only the spring-* library modules are scanned. framework-api, framework-bom, framework-docs, framework-platform and integration-tests are excluded.

Configuration required

The build script hardcodes no server details. Add these repository secrets before the workflow can report:

Secret Purpose
SONAR_HOST_URL Self-hosted SonarQube Server base URL
SONAR_TOKEN Analysis token with permission to create and submit projects

Each module's project must exist on the server (or auto-provisioning must be enabled) under its org.springframework:<module> key.

Created by a Sourcegraph agentic batch change.

Declares the org.sonarqube plugin in the root build and applies a new
gradle/sonar.gradle convention to every spring-* module so each one is
analyzed as its own SonarQube project keyed org.springframework:<module>,
instead of a single aggregated scan of the whole build.

Adds .github/workflows/sonar.yml, a matrix workflow running one scan job
per sub-module. Server URL and token are read from the SONAR_HOST_URL and
SONAR_TOKEN environment variables rather than being hardcoded.
@trly trly closed this Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant