简体   繁体   中英

Scala analysis with SonarQube 5.4

I want to know if SonarQube 5.4 supports scala? Can we perform scala analysis with respect to SonarQube? By default SonarQube does java analysis, I want to know if it works with scala because our code is built with sbt.

I've gone through some third party plugins like

  • Sagacify/sonar-scala
  • ncredinburgh/sonar-scalastyle
  • RadoBuransky/sonar-scoverage-plugin

Error during SonarQube Scanner execution:

ERROR: You must install a plugin that supports the language 'scala'
ERROR: 
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
ERROR: SonarQube scanner exited with non-zero code: 1

根据他们的主页 ( https://www.sonarqube.org/features/multi-languages/ ) 不支持 Scala。

I know this is a year old question. But I did integrate sonrqube-6.7.1 successfully in scala project for coverage as well as static code analysis.

  1. For code coverage report using scoverage

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")

  1. For code analysis using below plugin

addSbtPlugin("com.github.mwz" % "sbt-sonar" % "1.6.0")

  1. install sonarscala and scoverage plugins from Sonarqube marketplace

  2. configure sonar-scanner on server and envirnment variable SONAR_SCANNER_HOME = <>

  3. sbt sonarScan - this will publish reports to sonarqube

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM