Must-share information
-
SonarQube Server Version: Community Edition (running on Docker in an Azure VM)
-
SonarQube Scanner: Using
SonarQubePrepare@7,SonarQubeAnalyze@7, andSonarQubePublish@7tasks in Azure DevOps -
Languages/Projects: Spring Boot (Java), Swift, and Kotlin – multi-module projects
-
Azure DevOps Pipeline: Running on hosted agents (Ubuntu/macOS depending on the module)
Deployment Details
-
SonarQube is deployed using Docker on an Azure VM.
-
The pipeline is running in Azure DevOps with Community Edition integration.
What I am trying to achieve
I want to analyze a multi-module project (Java + Kotlin + Swift) with SonarQube in Azure DevOps.
Currently, I am using the sonar.modules + bind project approach to configure submodules manually.
Here is the snippet I am using:
- task: SonarQubePrepare@7
displayName: 'Prepare SonarQube Analysis'
inputs:
SonarQube: 'sonar'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: '$(SONAR_PROJECT_KEY)'
cliProjectName: 'server'
cliSources: '.'
extraProperties: |
sonar.projectVersion=1.0.2
sonar.sourceEncoding=UTF-8
sonar.exclusions=Dockerfile
sonar.modules=app,assets-module,core-module,kpi-module
app.sonar.projectBaseDir=app
app.sonar.sources=src/main/java
app.sonar.java.binaries=build/classes/java/main
assets-module.sonar.projectBaseDir=assets-module
assets-module.sonar.sources=.
assets-module.sonar.java.binaries=.
core-module.sonar.projectBaseDir=core-module
core-module.sonar.sources=.
core-module.sonar.java.binaries=.
kpi-module.sonar.projectBaseDir=kpi-module
kpi-module.sonar.sources=.
kpi-module.sonar.java.binaries=.
What I have tried so far
-
Used
sonar.modulesto define submodules manually. -
Used bind project approach in Azure DevOps.
-
Successfully ran analysis, but I am unsure if this is the best practice for multi-module projects.
Question
-
Is using bind project +
sonar.modulesthe correct approach for multi-module (Spring Boot + Kotlin + Swift) projects? -
What are the disadvantages of using bind project in this setup?
-
What is the recommended best practice for configuring SonarQube in Azure DevOps pipelines for multi-module projects?
