sonar-scala / sbt-sonar

An sbt plugin which provides an easy way to integrate Scala projects with SonarQube.

Home Page:https://sonar-scala.com/docs/setup/sbt-sonar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The 'sonar.scala.version' is not properly set or is missing

rohdef opened this issue · comments

Setting sonar.scala.version through sonarProperties doesn't seem to work :/

My build.sonar.sbt looks like:

    import sbtsonar.SonarPlugin.autoImport.sonarProperties
    
    sonarProperties ++= Map(
      "sonar.scala.version" -> "2.12.8",
      "sonar.projectName" -> "ticket-server",
      "sonar.projectKey" -> "ticket-server",
      "sonar.sources" -> "src/main/scala",
      "sonar.host.url" -> "http://localhost:9000",
      "sonar.sourceEncoding" -> "UTF-8"
    )

But in my output I get multiple warnings about it not being set:

    [info] INFO: Sensor Scala Sensor [scala]
    WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.12.'.
    [info] INFO: Sensor Scala Sensor [scala] (done) | time=127ms
    ...
    [info] INFO: Sensor Scapegoat Sensor [scala]
    WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.12.'.
    [info] INFO: [scapegoat] Initializing the Scapegoat sensor.
    ...
    [info] INFO: [scoverage] Initializing the scoverage sensor.
    WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.12.'.
    [info] INFO: [scoverage] Loading the scoverage report file: 'target/scala-2.12/scoverage-report/scoverage.xml'.

I've tried setting the value to: 2.12. 2.12.8, and even 2.12. (as that's how the default is written in the error)

Technically you don't even need to set this value as it's done automatically by the plugin, but yes, it looks like there is an issue (probably in sonar-scala). It won't cause any errors (that's probably why I've missed it), but I will have a look into this - thanks for reporting.

This should be fixed in the next release (sonar-scala/sonar-scala#139).

Neat, thanks a lot 👍