SonarQube server [http://localhost:9001] can not be reached

I have following step of setting up my repositories on sonar cloud using the given steps for ’ I have a pipeline’
I added the plugin
plugins {
id “org.sonarqube” version “”

and then updated my pipeline script with

depth: full # SonarCloud scanner needs the full history to assign issues properly

/gradlew --stacktrace bootJar sonar -Dsonar.gradle.skipCompile

But I get error

Task :sonar FAILED
SonarQube server [http://localhost:9001] can not be reached

Caused by: Connection refused

at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.platform.Platform.connectSocket(

at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.RealConnection.connectSocket(

I even tried following config in my build.gradle

sonar {
properties {
property “sonar.projectKey”, “<project_name>”
property “sonar.organization”, “<organization_name>”
property “”, “


You’ve omitted the [The docs](https://the Reference branch new code definition is not supported) should help.