Configuring SonarQube for Multi-Module Gradle Project with Separate Sonar Projects

SonarQube Version: v10.8.1
Scanner Version: 5.1.0.4882
Plugins Used: sonarqube-gradle-plugin
Deployment Method: gradle groovy, Github Action

I have a multi-module Gradle project, and I want to configure SonarQube so that each module publishes its analysis to a separate SonarQube project. I have gone over the documentation which explains about customizing sonar properties for specific module except the project key and project name.

Has anyone successfully configured SonarQube for this use case? Any guidance or example configurations would be greatly appreciated!

Hi,

Welcome to the community!

Could you explain why you want to do this?

You’re not going to be able to accomplish it in a single analysis. You’ll need to run an analysis per module/project, with the project key and name configured into each module (or passed on the analysis command line). Run the build for the whole project, then perform your module analyses one by one. Although, to be clear, I don’t know enough about Gradle to know whether running analysis at the module level will work.

 
HTH,
Ann