jacoco { toolVersion = "0.8.5" } jacocoTestReport { executionData tasks.withType(Test) classDirectories.from = files(sourceSets.main.output.classesDirs) sourceDirectories.from = files(sourceSets.main.java.srcDirs) reports { xml.enabled = true } } file("sonar-project.properties").withReader { Properties sonarProperties = new Properties() sonarProperties.load(it) sonarProperties.each { key, value -> sonarqube { properties { property key, value } } } }