Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
<div class="table-wrap"><table style="line-height: 1.4285715;" class="confluenceTable"><tbody><tr><td class="highlight-grey confluenceTd" data-highlight-colour="grey">By <a target="_top" href="">SonarSource</a> &#8211; GNU LGPL 3 &#8211;
<a target="_top" href="">Issue Tracker</a> &#8211;
<a target="_top" href="">Sources</a>
    <div style="padding-top:10px;padding-bottom:5px">
    <span style="font-size:larger;"><strong>SonarQube Scanner for Gradle 2.6.1</strong></span>
     &#8211; Compatible with SonarQube 5.6+ (LTS)
</div> </td></tr></tbody></table></div>


gradle sonarqube -Dsonar.verbose=true
While certainly useful at times, we do recommend to keep the bulk of the configuration in a (versioned) build script, readily available to everyone.

A SonarQube property value set via a system property overrides any value set in a build script (for the same property). When analyzing a project hierarchy, values set via system properties apply to the root project of the analyzed hierarchy. Each system property starting with ""sonar." will be taken into account.

Task dependencies

Before executing the sonarqube task, all tasks producing output to be included in the SonarQube analysis need to be executed. Typically, these are compile tasks, test tasks, and code coverage tasks. To meet these needs, the plugins adds a task dependency from sonarqube on test if the java plugin is applied. Further task dependencies can be added as needed. For example:

Code Block
project.tasks["sonarqube"].dependsOn "anotherTask"



A simple working example is available at this URL so you can check everything is correctly configured in your env: