# Gradle Sonarqube task not found

**URL:** <https://community.sonarsource.com/t/gradle-sonarqube-task-not-found/46260>\
**Category:** SonarQube Server / Community Build\
**Tags:** gradle\
**Created:** [July 9, 2021, 6:32pm UTC](https://community.sonarsource.com/t/gradle-sonarqube-task-not-found/46260 "2021-07-09T18:32:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcrocker](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jcrocker](https://community.sonarsource.com/u/jcrocker)\
**Post date:** [July 9, 2021, 6:32pm UTC](https://community.sonarsource.com/t/gradle-sonarqube-task-not-found/46260/1 "2021-07-09T18:32:25Z")

</div>

Sonar: 8.9, Gradle Plugin Version: 3.3

I am trying to upgrade to version 3.3 of the gradle plugin (from version 2.8) and in 8.9 documentation for the gradle plugin ([SonarScanner for Gradle | SonarQube Docs](https://docs.sonarqube.org/8.9/analysis/scan/sonarscanner-for-gradle/#header-5)) I notice that starting with 3.x of the plugin it no longer creates task dependencies to the tasks that generate output. The listed solution is to create these dependencies yourself with `project.tasks["sonarqube"].dependsOn "anotherTask"`. That is easy enough so I have this in my build file:

```auto
   project.plugins.apply("org.sonarqube")
   project.tasks["sonarqube"].dependsOn "test"

```

The problem is this causes the error “Task with name ‘sonarqube’ not found in project” during configuration phase of the build on the line where I am setting dependsOn. So why isn’t the sonarqube task available _after_ I apply the org.sonarqube plugin? If I remove the dependsOn line I can execute the sonarqube task so at some point it gets added to the gradle task graph. When during config phase is the sonarqube task actually added to the task graph?
