Configuring Maven multi-module (monorepo) project in sonarcloud

Hello,

I am having some trouble setting up Sonarcloud for a Bitbucket repository that contains a multi-module Maven project. The project is contained in a single repository that I selected when creating the new project in Sonarcloud. However, each Maven module has its own Azure Devops CI pipeline and publishes JaCoCo reports on its own. It’s currently unclear how to configure this (yml) pipeline so that these individual modules map to the single Sonarcloud project. I am using this example to configure the Devops pipelines: https://github.com/SonarSource/sonar-scanner-vsts/blob/master/yaml-pipeline-templates/maven-sonarcloud.yml
I read about a sonar.moduleKey setting, but it seems this is deprecated as I can’t seem to find it in the docs: https://docs.sonarqube.org/latest/analysis/analysis-parameters/

Ideally all of these modules would be part of 1 project in Sonarcloud, if this isn’t possible multiple projects could work as well. But it seems Bitbucket repo -> Sonarcloud project is a 1 to 1 mapping.

Appreciate any help!

Hi @GlennC and welcome to the community !

Yes currently mono-repo are not supported for BitBucket on SonarCloud.

You will need to have one analysis per SonarCloud project to make that work.

Mickaël

Hi @GlennC and welcome to the community!
Unfortunately the monorepo setup is not available from a Bitbucket account.
To enable it, you must get connected with either a Github account or an Azure DevOps account. https://sonarcloud.io/documentation/analysis/setup-monorepo/

Kind regards,
Christophe

Thanks @mickaelcaro @Christophe_Havard, I will have a look at the Azure DevOps setup.