提交 0ecede02 编写于 作者: B Brian Clozel 提交者: Stephane Nicoll

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
上级 2e7470b2
...@@ -10,6 +10,10 @@ buildscript { ...@@ -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 -> ...@@ -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") { ...@@ -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) { ...@@ -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/**/*"
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册