I am using SonarCE version 9.7 along with sonar sbt plugin, I have setup my config for a scala project in the build.sbt for the following format:
sonarProperties := Map(
“sonar.host.url” → “https://sonarqube.hub.company.com”,
“sonar.projectKey” → “com-xxx-data”,
“sonar.login” → “******”,
“sonar.language” → “scala”,
“sonar.verbose” → “true”,
“sonar.sourceEncoding” → “UTF-8”,
“sonar.projectName” → “CatService”,
“sonar.modules” → “service,dataMigration”,
“service.sonar.projectName” → “service”,
“dataMigration.sonar.projectName” → “dataMigration”,
“service.sonar.sources” → “src/main/scala”,
“service.sonar.tests” → “src/test/scala”,
“service.sonar.scala.coverage.reportPaths” → “target/scala-2.13/scoverage-report/scoverage.xml”,
“service.sonar.scala.scapegoat.reportPath” → “target/scala-2.13/scapegoat-report/scapegoat.xml”,
“dataMigration.sonar.sources” → “src/main/scala”,
“dataMigration.sonar.scala.coverage.reportPaths” → “target/scala-2.13/scoverage-report/scoverage.xml”,
“dataMigration.sonar.scala.scapegoat.reportPath” → “target/scala-2.13/scapegoat-report/scapegoat.xml”
)
The project runs fine and I am successfully able to import results to my hosted sonar instance, but I always see an error:
[error] SonarQube server [http://localhost:9000] can not be reached
[error] SonarQube server [http://localhost:9000] can not be reached
followed by:
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarScanner analysis
[error] at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:85)
[error] at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
[error] at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:74)
[error] at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:70)
[error] at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:185)
[error] at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:123)
I tried to override the config by using the -D flag and it works but somehow the build.sbt is not able to override the localhost url. How do I override this value in my config?