]> source.dussan.org Git - poi.git/commitdiff
migrate to sonarcloud.io
authorAndreas Beeker <kiwiwings@apache.org>
Tue, 12 Nov 2019 22:50:30 +0000 (22:50 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Tue, 12 Nov 2019 22:50:30 +0000 (22:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1869712 13f79535-47bb-0310-9956-ffa450edef68

build.gradle
jenkins/create_jobs.groovy

index 85faeb64e2b99ccfc07ddfa57c92d19653a0ea58..c95eae0360e9b8eeeb7d936823c23a7a6c1e5f50 100644 (file)
@@ -20,8 +20,8 @@ buildscript {
     }
 
     dependencies {
-        classpath 'me.champeau.gradle:japicmp-gradle-plugin:0.1.2'     // 2.x requires Gradle >=4
-        classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.5"
+        classpath 'me.champeau.gradle:japicmp-gradle-plugin:0.2.8'     // 2.x requires Gradle >=4
+        classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8"
     }
 }
 
index c1c3c582463f66c7a414d9f9e6067a649c7b2580..b130deb5aa953bfd6721be6ef95a8dfe11fad523 100644 (file)
@@ -135,6 +135,8 @@ def apicheckDesc = '''
 </p>
 '''
 
+def sonarOptions = '-Dsonar.projectKey=poi-parent -Dsonar.organization=apache -Dsonar.host.url=https://sonarcloud.io '
+
 def sonarDesc = '''
 <p>
 <b><a href="lastSuccessfulBuild/findbugsResult/" target="_blank">Findbugs report of latest build</a></b> -
@@ -297,7 +299,9 @@ poijobs.each { poijob ->
                 */
                 maven {
                     if(poijob.sonar) {
-                        goals('compile $SONAR_MAVEN_GOAL -Dsonar.host.url=$SONAR_HOST_URL')
+                        withCredentials([string(credentialsId: 'sonarcloud-poi', variable: 'SONAR_TOKEN')]) {
+                            goals('compile sonar:sonar -Dsonar.login=${SONAR_TOKEN} ' + sonarOptions)
+                        }
                     } else {
                         goals('package')
                     }
@@ -364,11 +368,13 @@ poijobs.each { poijob ->
         } else if(poijob.sonar) {
             steps {
                 shellEx(delegate, shellcmds, poijob)
-                gradle {
-                    switches('-PenableSonar')
-                    switches('-Dsonar.host.url=$SONAR_HOST_URL')
-                    tasks('sonarqube')
-                    useWrapper(false)
+                withCredentials([string(credentialsId: 'sonarcloud-poi', variable: 'SONAR_TOKEN')]) {
+                    gradle {
+                        switches('-PenableSonar')
+                        switches('-Dsonar.login=${SONAR_TOKEN} ' + sonarOptions)
+                        tasks('sonarqube')
+                        useWrapper(false)
+                    }
                 }
             }
             publishers {