Gradle Wont Scan


I have a Java project built with Gradle. The deployment process runs off Azure.

I have added the following to the Azure Pipeline.yml

        # Prepare Analysis Configuration task (SonarQube)
      - task: SonarQubePrepare@4
        condition: eq(variables['Build.SourceBranchName'], 'main')
          SonarQube: 'SonarQube-Demo'
          scannerMode: 'Other'
          extraProperties: 'sonar.projectKey=Java-Project'
      # Publish Quality Gate Result task (SonarQube)
      - task: SonarQubePublish@4
        condition: eq(variables['Build.SourceBranchName'], 'main')
           pollingTimeoutSec: '300'

and inside build.gradle

plugins {
  // Used to analyise the code base on compile
  id "org.sonarqube" version "3.3"

When i run the pipeline, nothing is anylised. I have read the documentation here:
[Azure DevOps Integration ]
SonarScanner for Gradle | SonarQube Docs

but nothing is pushed to SonarQube

Any help is appreciated