Sonarcloud over a Gradle multi-project repo

Template for a good new topic, formatted with Markdown:

  • 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
    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

Hey there.

It looks like the analysis ran successfully – are you expecting different results?

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 :confused:

Ok, I will clarify the issue since I have some time.
According to Structuring Large Projects - Gradle, the recommended modern Gradle setup would be the following for large projects:

├── 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 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?