Integrating scala sbt jenkins and sonar

The Coursera Functional Programming Principles in Scala course has motivated me to start using Scala more seriously and this means integrating it into my development environment.

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.

  1. Netbeans and Scala
    Described on Geertjen Wielenga’s site here and demo’d by him here.
  2. Sublime and sbt
    Jason Arhart’s SublimeSBT plugin; the site has the installation instructions.
  3. Scala static code analysis and sbt
    Scalastyle. The sbt plugin for Scalastyle is here. Make sure you create a scalastyle configuration file with the scalastyleGenerateConfig command before running the scalastyle command.
  4. Scala code coverage and sbt
    Scoverage in the sbt build. Note the sbt command here is coverage. Another page on the site shows scoverage:test as the command. coverage appears correct with version 1.0.1. I suspect the latter was for an earler version.
  5. Jenkins and sbt
    The Jenkins application sbt plugin.
  6. Jenkins and SonarQube
    The Jenkins application Sonar plugin.
  7. 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.
  8. SonarQube and scoverage
    Rado Buransky’s Sonar Scoverage plugin.

One thought on “Integrating scala sbt jenkins and sonar

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.