Use the official SonarQube Gradle plugin
Since the build has been upgraded to Gradle 2.10, it's showing the following message: "The 'sonar-runner' plugin has been deprecated and is scheduled to be removed in Gradle 3.0. please use the official plugin from SonarQube" This commit makes use of the "org.sonarqube" Gradle plugin and uprgrades the Jacoco agent version to 0.7.5. See: https://sonar.spring.io/updatecenter/updates See: https://jira.sonarsource.com/browse/SONARJAVA-1091 Closes gh-949
This commit is contained in:
parent
2e7470b27f
commit
0ecede028c
20
build.gradle
20
build.gradle
|
@ -10,6 +10,10 @@ buildscript {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id "org.sonarqube" version "1.1"
|
||||||
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
linkHomepage = 'https://projects.spring.io/spring-framework'
|
linkHomepage = 'https://projects.spring.io/spring-framework'
|
||||||
linkCi = 'https://build.spring.io/browse/SPR'
|
linkCi = 'https://build.spring.io/browse/SPR'
|
||||||
|
@ -218,11 +222,11 @@ configure(subprojects - project(":spring-build-src")) { subproject ->
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
jacoco("org.jacoco:org.jacoco.agent:0.7.1.201405082137:runtime")
|
jacoco("org.jacoco:org.jacoco.agent:0.7.5.201505241946:runtime")
|
||||||
}
|
}
|
||||||
|
|
||||||
gradle.taskGraph.whenReady {taskGraph ->
|
gradle.taskGraph.whenReady {taskGraph ->
|
||||||
if (taskGraph.hasTask(':sonarRunner')) {
|
if (taskGraph.hasTask(':sonarqube')) {
|
||||||
test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*"
|
test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1140,10 +1144,8 @@ project("spring-framework-bom") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'sonar-runner'
|
sonarqube {
|
||||||
|
properties {
|
||||||
sonarRunner {
|
|
||||||
sonarProperties {
|
|
||||||
property "sonar.projectName", "Spring Framework"
|
property "sonar.projectName", "Spring Framework"
|
||||||
property "sonar.profile", "Spring Framework"
|
property "sonar.profile", "Spring Framework"
|
||||||
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
|
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
|
||||||
|
@ -1399,14 +1401,14 @@ configure(rootProject) {
|
||||||
}
|
}
|
||||||
|
|
||||||
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
|
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
|
||||||
sonarRunner {
|
sonarqube {
|
||||||
skipProject = true
|
skipProject = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
configure(project(':spring-core')) {
|
configure(project(':spring-core')) {
|
||||||
sonarRunner {
|
sonarqube {
|
||||||
sonarProperties {
|
properties {
|
||||||
property "sonar.exclusions",
|
property "sonar.exclusions",
|
||||||
"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
|
"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue