Sonarqube gradle plugin task not available on dependency sub module

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube Gradle plugin: v3.3

  • what are you trying to achieve
    Make the sonarqube gradle task run for a nested android module, which lives under another android module in the project repository structure.
    Due to the way our CI is setup. We need to run a separate workflow for all our different android modules with tests and then push up the coverage data to sonarcloud using the gradle task from the individual workflows.
    The regular android dependency modules work as expected. But this one nested dependency module does not list the sonarqube task to be available.

  • what have you tried so far to achieve this

  1. Moved sonarqube configuration to allProjects in the root gradle file(which we do not want to do as it will apply it for all modules, which is unnecessary for us).
  2. Changing module name from :provider:onboarding to :onboarding in the dependencies list in the parent android module.
  3. applying plugin with plugin id not apply plugin

Also, there are no warnings, which might indicate we’re missing something. But I am out of ideas with no errors and why it works on a dependency module at the same level but not on a nested module.

Thanks for the help.

I have a multi module set up in my android project. And one of them has a feature module nested as well. I am using the latest version of sonarqube(3.3) as well. But I see the extension applied to the feature module, but the sonarqube task is not configured and available.

The way our CI workflows work, I need to be able to run the tests/coverage on each of the modules(including the feature modules) separately and hence I am stuck with the sonar gradle plugin not working in this case.

My project structure:

  • repo-root
    • app-module (works)
      • feature-module (DOES NOT work)
    • networking-module (works)
    • domain-module (works)

I tried applying the sonarqube plugin directly from the root gradle script and individually on each of the module’s gradle. Makes no difference.

Any suggestions/tips? Thanks in advance.