Sonarcloud intergation error

HI Github Support
we are facing an error when we tried to integrate Sonarcloud with Bamboo server. we have a paid plan in Sonarcloud(Github). but when we try to connect to sonarcloud. Bamboo gives me a No organization with key error. but the organization name is correct. please kindly refer to the screenshot. Thank you
image

Hi @fjiang-aamc

The URL targeted is a SonarQube one, no link are established between SonarCloud and SonarQube, so i think you’d better review your configuration to target one or the other.

HTH,
Mickaël

hi @mickaelcaro
Thank you for your quick response. the interesting situation is we are actually targeting Sonarcloud, instead of sonarqube. we were following this document to configure our bamboo job. ( https://sonarcloud.io/project/configuration?id=aamc-org_eras-pdws-web&analysisMode=GitHubOtherCI ). please kindly review the screenshot of the settings , and please let us know which part is missing?

. thank you

Best,
Fei

Try to put another property : -Dsonar.host.url=https://sonarcloud.io/ in the goal and see if it’s better.

HI Caro
Thank you for your help. we are facing a new issue which is *

Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project eras-application-service: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar: java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0*

Our maven Java project is currently in Java 1.8, and looks like sonar needs Java 1.11 to do the analysis job.
i added the property -Dsonar.java.source=1.11 in the goal but still face the same issue. is there something i missed or need to set the property in sonar-project.properties and if it is needed. where should I create the sonar-project.properties? in pom.xml or in the root. Could you please share with me a example? thank you so much

Hi,

You need to run analysis with Java 11. You can either split it out to a separate step with its own JVM, or you can compile with Java 11 and target Java 8 for the compile.

 
HTH,
Ann

Hi Ann
thank you for your quick help. we inserted maven compiler properties and sonar.java.source into pom.xml → properties field. but still face the same issue. Could you please take a look? thank you.
2022-03-24_21-29-55

Best,
Fei

Hi Fei,

Did you switch your JRE to Java 11?

 
Ann

no, we are using JAVA 1.8. and this is required i think.

Hi,

This isn’t going to work until you use Java 11 for the analysis.

 
HTH,
Ann

Hi Ann
we have set maven.compiler.source and maven.compiler. target. is it not enough?

No. It’s not

HI Ann
thank you for your help, we enable to trigger a sonarcloud analysis from bamboo. but recently we are facing a new issue. when I add a new project from sonarcloud console. the sonarcloud automatically analysis the project in GitHub which is not I want. and when i trigger a sonarcloud analysis from bamboo. there was an error throw by sonarcloud: [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project eras-dws-doc-service: You are running manual analysis while Automatic Analysis is enabled. Please consider disabling one or the other.. But i didn’t enable the automatic analysis when I add the project. Could you please take a look and how to turn off the Automatic Analysis. thank you


Best
Fei

Hi Fei,

Usually a new question needs a new thread, but this one’s pretty simple. You can turn off automatic analysis in project administration. The docs should help.

 
HTH,
Ann

thank you for sharing the documents.