title: How to specify test task run by Gradle SonarQube plugin
body: <p>I am using Gradle with the sonarqube plugin and triggering it using </p>
  
  <pre><code>gradle sonarqube
  </code></pre>
  
  <p>However, it is calling the built in "test" task which runs all types of tests including the integration tests which do not all pass at the moment. I want to be able to specify that the sonarqube task use something like a "unitTest" task instead of the "test" task which runs everything.</p>
  
  <p>Other people on the team run cucumber tests within the IDE which also uses the test task, so currently when I exclude cucumber tests in the main "test" task, they have to comment that excludes out in order for their cucumber tests to be kicked off, which is not ideal.</p>
  
  <p>I am including sonarqube using the below syntax:</p>
  
  <pre><code>plugins {
      id "org.sonarqube" version "2.5"
  }
  </code></pre>
  
  <p>How can I make the sonarqube task use another test task?</p>
  
  <p><strong>Update:</strong> </p>
  
  <p>Got it to work with the below code, made subprojects run their unitTests first to generate required test report data and then run sonarqube task. </p>
  
  <pre><code>// Removes the dependency on main test task and runs unitTests for test code coverage statistics
  tasks['sonarqube'].with {
      dependsOn.clear()
      subprojects.each { dependsOn("${it.name}:unitTests") }
  }
  </code></pre>
  
  <p>dependsOn.clear() clears all dependencies, so if there were multiple, I would probably have to do something like </p>
  
  <pre><code>taskName.enabled=false
  </code></pre>
  
  <p>and then re-enable it after the task was done unless there is a easier way to do it? I've tried dependsOn.remove("test") but that didn't work.</p>