Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Settings with Subprojects #246

Open
DavidPerezIngeniero opened this issue Aug 10, 2022 · 1 comment
Open

Settings with Subprojects #246

DavidPerezIngeniero opened this issue Aug 10, 2022 · 1 comment

Comments

@DavidPerezIngeniero
Copy link

DavidPerezIngeniero commented Aug 10, 2022

I have:

addSbtPlugin("com.sonar-scala" % "sbt-sonar" % "2.3.0")

I have:

sonarProperties ++= Map(
	"sonar.host.url" -> "https://sonar.mydomain.com",
	"sonar.login" -> "admin",
	"sonar.password" -> "secret",
)
subproject/sonarProperties ++= Map(
	"sonar.host.url" -> "https://sonar.mydomain.com",
	"sonar.login" -> "admin",
	"sonar.password" -> "secret",
)

Then:

show sonarProperties

subproject / sonarProperties
[info]  Map(sonar.scala.scapegoat.reportPath -> target/scapegoat-report/scapegoat.xml, sonar.sources -> src/main/scala, sonar.sourceEncoding -> UTF-8, sonar.projectName -> subproject, sonar.projectBaseDir -> /sv/subproject, sonar.tests -> src/test/scala, sonar.projectKey -> subproject, sonar.scala.version -> 2.13.7, sonar.scala.scoverage.reportPath -> target/scoverage-report/scoverage.xml)

sonarProperties
 Map(sonar.scala.scapegoat.reportPath -> target/scala-2.12/scapegoat-report/scapegoat.xml, sonar.sources -> src/main/scala, sonar.sourceEncoding -> UTF-8, sonar.login -> admin, sonar.password -> secret, sonar.projectName -> TodoVision, sonar.projectBaseDir -> /sv, sonar.host.url -> https://sonar.domain.com, sonar.tests -> src/test/scala, sonar.projectKey -> todovision, sonar.scala.version -> 2.12.16, sonar.scala.scoverage.reportPath -> target/scala-2.12/scoverage-report/scoverage.xml)

If I try to run subproject/sonarScan then it tries to access http://localhost/9000 instead of my customized server.

SBT version 1.7.1

@DavidPerezIngeniero
Copy link
Author

Workaround is to define Java System properties:

sbt \
  -Dsonar.host.url=https://sonar.domain.com \
  -Dsonar.login=admin \
  -Dsonar.password=secret

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant