SonarCloud Analysis is failing in Azure DevOps pipeline with Gradle build

  1. SonarQube scanner for Gradle plugin version ----------> 2.6.1

  2. error observed ------> Main component does not belong to specified organization

  3. steps to reproduce ----------->
    a) I have configured the SonarQube scanner in DevOps pipeline using gradlew build.
    b) Run the pipeline. Getting above mentioned error.


It’s likely that the computed projectKey (from the gradle property file) already exist in the SonarCloud db. The project key should be unique across all SonarCloud for the moment.

Try to specify a project key using the sonar.projectKey property in the Additional properties field in the Prepare analysis configuration task.