# Sonarcloud over a Gradle multi-project repo

**URL:** <https://community.sonarsource.com/t/sonarcloud-over-a-gradle-multi-project-repo/60834>\
**Category:** SonarQube Cloud\
**Tags:** gradle, java\
**Created:** [March 31, 2022, 7:37am UTC](https://community.sonarsource.com/t/sonarcloud-over-a-gradle-multi-project-repo/60834 "2022-03-31T07:37:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ennioVisco](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/enniovisco/32/29427_2.png) [@ennioVisco](https://community.sonarsource.com/u/ennioVisco)\
**Post date:** [March 31, 2022, 7:37am UTC](https://community.sonarsource.com/t/sonarcloud-over-a-gradle-multi-project-repo/60834/1 "2022-03-31T07:37:26Z")

</div>

Template for a good new topic, formatted with [Markdown](https://commonmark.org/help/):

- ALM used: Github
- CI system used: Github Actions
- Scanner command used when applicable (private details masked)
- Java 8, moving to 17. Scripts in Gradle (kotlin DSL)
- Repo URL: [https://github.com/MoonLightSuite/MoonLight](https://github.com/MoonLightSuite/MoonLight)  
Was anyone able to run Sonarcloud via CI in a multi-project repo?  
We are trying to do this, but the gradle plugin doesn’t seem to be very helpful for this purpose. It would be nice if it did, considering that this is the recommended architecture in [current Gradle docs](https://docs.gradle.org/current/userguide/structuring_software_products.html#structure_large_projects)

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [March 31, 2022, 8:17am UTC](https://community.sonarsource.com/t/sonarcloud-over-a-gradle-multi-project-repo/60834/2 "2022-03-31T08:17:11Z")

</div>

Hey there.

[It looks like the analysis ran successfully](https://sonarcloud.io/summary/new_code?id=MoonLightSuite_MoonLight) – are you expecting different results?

---

<div class="post-metadata">

**Author:** ![ennioVisco](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/enniovisco/32/29427_2.png) [@ennioVisco](https://community.sonarsource.com/u/ennioVisco)\
**Post date:** [March 31, 2022, 8:43am UTC](https://community.sonarsource.com/t/sonarcloud-over-a-gradle-multi-project-repo/60834/3 "2022-03-31T08:43:30Z")

</div>

Unfortunatly not: it runs fine if I execute the command from the command line of the IDE, not from the CI.  
Moreover, it still only considers one project of the 4 that are defined in the repo 😕

---

<div class="post-metadata">

**Author:** ![ennioVisco](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/enniovisco/32/29427_2.png) [@ennioVisco](https://community.sonarsource.com/u/ennioVisco)\
**Post date:** [April 15, 2022, 3:09pm UTC](https://community.sonarsource.com/t/sonarcloud-over-a-gradle-multi-project-repo/60834/5 "2022-04-15T15:09:35Z")

</div>

Ok, I will clarify the issue since I have some time.  
According to [Structuring Large Projects - Gradle](https://docs.gradle.org/current/userguide/structuring_software_products.html), the recommended modern Gradle setup would be the following for large projects:

```auto
├── android-app
│ └── settings.gradle.kts
...
├── state
│ └── settings.gradle.kts
│
├── build-logic
│ └── settings.gradle.kts
...

```

This scenario may (or may not) be 100% Java-based but most certainly defines a JVM monorepo.

Typically, large projects are also the ones for which Sonarcloud/Sonarqube is more valuable, so one might want to set it up. However, the [Sonarqube - Gradle Plugin](https://plugins.gradle.org/plugin/org.sonarqube) doesn’t seem to have such a use case in mind, and that’s basically the origin of my question: is there a known way to set-up a grade multi-project as a Sonarcloud monorepo, automatizing, of course, the analysis in the CI workflow of the repo?
