Integrating scala sbt jenkins and sonar
I use a mixture of Netbeans and Sublime as the IDE. These are used with sbt. Jenkins is used for the automated build, test and release. Jenkins also publishes code quality metrics and test results to SonarQube.
This is a summary of plugins and configurations which has help me glue all these together. It's the result of searching for suitable and (at the time) up-to-date plugins that can be used. Some of these seem to be fairly young and, as a result I'm not sure if I selected the one(s) that may eventually become defacto. Nevertheless I hope this list will be useful to anyone wishing to set up a similar environment.
The references and links summarise the items I have ended up selecting and using. Follow these for updates, installation and configuration information.
- Netbeans and Scala
Described on Geertjen Wielenga's site here and demo'd by him here.
- Sublime and sbt
Jason Arhart's SublimeSBT plugin; the site has the installation instructions.
- Scala static code analysis and sbt
Scalastyle. The sbt plugin for Scalastyle is here. Make sure you create a scalastyle configuration file with the
scalastyleGenerateConfigcommand before running the
- Scala code coverage and sbt
Scoverage in the sbt build. Note the sbt command here is
coverage. Another page on the site shows
scoverage:testas the command.
coverageappears correct with version 1.0.1. I suspect the latter was for an earler version.
- Jenkins and sbt
The Jenkins application sbt plugin.
- Jenkins and SonarQube
The Jenkins application Sonar plugin (dead link).
- SonarQube and scalastyle
NCR Edinburgh's or Emrehan Tuzun's Sonar Scalastyle plugin. NCR Edingburh's is here. Emrehan Tuzan's is here. One is a fork of the other. They're both version 0.0.1, but seem to integrate into SonarQube well. Keep an eye out for which one gets maintained and updated. Note the requirement for a sonar-project.properties file. This duplicates some data from the sbt file, e.g. project names & versions.
- SonarQube and scoverage
Rado Buransky's Sonar Scoverage plugin.
Posted: November 29, 2014