Skip to content

schleichardt/sbt-sonar

Repository files navigation

sbt-sonar

SBT plugin to generate sonar properties for projects.

Work in progress without warranties.

It should work with SBT 0.11.3, 0.12.x and 0.13.0.

Usage

Add to project/plugins.sbt:

//release versions will be pushed to Maven Central
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

addSbtPlugin("info.schleichardt" % "sbt-sonar" % "TODO")

Add to build.sbt (project/Build.scala see beyond):

sonarSettings

OR project/Build.scala:

import info.schleichardt.sbt.sonar.SbtSonarPlugin._

val main = project(...).settings(sonarSettings:_*)

Run sonar:

sbt test sonar

Use the gen-sonar-prop task after the testing tasks, since the configuration checks for existing folders.

Customization

Override or Add settings in build.sbt

0.13.0:

sonarProperties := sonarProperties.value ++ 
Map("sonar.projectName" -> "override-name", "new.key" -> "new.value")

Older SBT

sonarProperties ~= { old => old ++ 
Map("sonar.projectName" -> "override-name", "new.key" -> "new.value") }

Other Stuff

  • Do not use it with Play 2.1.3, Play has problems to generate correct test reports.

About

SBT plugin to generate sonar properties for projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published