Configuring Maven multi-module (monorepo) project in sonarcloud


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:
I read about a sonar.moduleKey setting, but it seems this is deprecated as I can’t seem to find it in the docs:

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.


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.

Kind regards,

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