Disable automatic analysis to SonarCloud for Sonar Scanner CLI 6.0

Hi,

I have a custom docker image that contains sonarqube-9.9.5.90363 and sonar-scanner-cli 6.0.0.4432. When running sourceanalyzer to scan a project, there’s an additional step that tries to hit the sonarcloud api endpoint - https://api.sonarcloud.io/analysis/

It appears that sonarscanner cli 6.0 has included automatic analysis to sonarcloud.
I am currently with limited network access which does not whitelist sonarcloud api endpoint. Is there any way that I can disable the automatic analysis to sonarcloud and just let the remaining scan to proceed? I am only facing this issue when i upgrade sonarscanner cli from v5 to v6.

Given that I am running this as a image for cicd pipeline (which is not able to access the UI), is there any command parameters that i can include in to disable automatic analysis when running the sourceanalyzer on cli?

Any help is greatly appreciated. Thank you?

Hi,

The documentation doesn’t highlight this change, but previously, up to SonarScanner CLI 5.x, the default setting for the property sonar.host.url was http://localhost:9000 when not specified. However, starting with version 6.0, the default has been switched to https://sonarcloud.io.

So, from now on, you’ll need to explicitly set this property for SonarScanner, like so: -Dsonar.host.url=http://localhost:9000.

(Also, I must say that starting a temporary instance of SonarQube in the CI/CD pipeline is somewhat strange. By doing so, you may be mising many of the features that SonarQube offers.)