I'm trying to convert my configuration from the old gradle 'sonar' plugin to the new gradle 'sonar-runner' plugin for gradle 1.5.
Since I switched to the sonar-runner plugin, sonar is no longer reusing my cobertura coverage.xml to calculate unit test coverage. I can't find any examples in the sonar-runner user guide showing how to configure this. Previously I was using the sonar.project.coberturaReportPath to specify the location of my coverage.xml.
My sonar instance is v.3.4. I'm using a gradle cobertura plugin to generate my coverage.xml.
Here's my sonar-runner configuration:
sonarRunner {
sonarProperties{
property "sonar.host.url", "http://sonar"
property "sonar.jdbc.url", "jdbc:mysql://sonar:3306/sonar"
property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver"
property "sonar.username", "username"
property "sonar.password", "password"
property "sonar.language", "grvy"
property "sonar.coberturaReportPath", file("$buildDir/reports/cobertura/coverage.xml") //not sure if this is right!
}
}
Here's my old sonar configuration (which worked!):
sonar {
server {
url = "http://sonar"
}
database {
url = "jdbc:mysql://sonar:3306/sonar"
driverClassName = "com.mysql.jdbc.Driver"
username = "username"
password = "password"
}
project {
language = "grvy"
coberturaReportPath = file("$buildDir/reports/cobertura/coverage.xml")
}
}