Skip to content

aol/sbt-sonarrunner-plugin

Repository files navigation

sbt-sonarrunner-plugin

An SBT plugin to publish code quality data to SonarQube

Build status

Build health

Installation

NOTE this plugin targets sbt 1.1.0+

Add the following to your project/plugins.sbt file:

addSbtPlugin("com.aol.sbt" % "sbt-sonarrunner-plugin" % "1.1.0")

To use the SonarRunner settings in your project, add the SonarRunnerPlugin auto-plugin to your project.

enablePlugins(SonarRunnerPlugin)

Configuration

To use specific Sonar settings, add the following to your build.sbt file:

sonarProperties ++= Map(
      "sonar.host.url" -> "http://sonarhostname.com",
      "sonar.jdbc.username" -> "sonar",
      "sonar.jdbc.password" -> "sonar",
      "sonar.coverage.exclusions" -> "**/MobileAppController.java,**/SomeClass.java"
    )

You can also specify the following sonar-runner options:

-D,--define <arg>     Define property
-e,--errors           Produce execution error messages
-h,--help             Display help information
-v,--version          Display version information
-X,--debug            Produce execution debug output
sonarRunnerOptions := Seq("-e", "-X")

Run Sonar

    sbt sonar

Full list of Sonar analysis parameters

http://docs.sonarqube.org/display/SONAR/Analysis+Parameters

Bintray

https://bintray.com/aol/scala/sbt-sonarrunner-plugin/view

Author

maestr0 - Pawel Raszewski