Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-6724

Support modules having both source code and submodules



      The current state is that a module can either be:

      • an aggregator module having submodules and no source dir/files
      • a leaf module having source dir/files but no submodule

      This model was inspired by Maven but doesn't fit well for some other use cases like:

      • analyze of Gradle projects where there is no such constraint
      • analyze of pom.xml in every modules (even in aggregators)

      We should support natively this, it means source code must be indexed by batch in every module, aggregation must support modules having a mix of source dirs and submodules as children, and UI must be able to display a mix of source dirs and submodules as children in module drilldown.

      As a side note this will probably show limitation of our property based configuration with simple inheritance. Today, when you specify sonar.sources=src on an aggregator module, it means:

      • apply this configuration to all my children (and ignore it for myself)

      When you specify sonar.sources=src on a leaf module, it means:

      • there is a src folder in this module (and we can fail fast if the folder is missing)

      Tomorrow when we will support modules having both source and submodules, sonar.sources=src will be confusing:

      • does it apply to current module?
      • does it apply to submodules (inheritance)?
      • both?

      For example in Gradle this is solved using this syntax:

      Apply only to current module (no inheritance):

      sonarqube {
        skip: true

      Apply only to children modules:

      subprojects {
        sonarqube {
          skip: true

      Apply both to current module and to children modules:

      projects {
        sonarqube {
          skip: true


          Issue Links



              • Assignee:
                janos.gyerik Janos Gyerik
                julien.henry Julien Henry
              • Votes:
                1 Vote for this issue
                5 Start watching this issue


                • Due: