Scanner command used when applicable (private details masked)
Languages of the repository JAVA
Only if the SonarCloud project is public, the URL - Not Public.
Error observed main component does not belong to specified organization
Steps to reproduce
Added OOB tasks
Prepare Analysis On SonarCloud Before gradlew Build
and after that added
Publish Quality Gate Result
On gradlew build task I checked Run SonarQube or SonarCloud Analysis
SonnarQube Scanner field: 2.7.1 also tried with 2.6.1 and 2.8
Hi, I am trying to use SonarCloud on an Azure DevOps Build Pipeline per the instructions found here
and I am getting the specified error.
Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ā:sonarqubeā.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:166)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:163)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:156)
ā¦
main component does not belong to specified organization
Hello Michael
First of all, thanks for your answer.
Organization is automatically populated when you configure the SonarCloud Service Endpoint in Azure Devops.
Project Key is NOT an option when you select āIntegrate with Maven or Gradleā on the Prepare Analysis on SonarCloud task:
Yes, in gradle/maven mode, the project key is deduced from gradle/maven properties, and this is the main reason why this message could appear : from some reason, if you havenāt created your project yet on SonarCloud, the project key might already exist. You can override this by setting sonar.projectKey in the Additional properties field, under āAdvancedā tab of the configuration.
We have something in the pipe to let the user the possibility to override directly in the config (not hidden in advanced properties) the key of the project for Gradle/Maven, but no ETA yet.