This is an automated email from the ASF dual-hosted git repository.

zabetak pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 96d1635f98d HIVE-29196: Apply and report checkstyle issues via 
Sonarqube (#6076)
96d1635f98d is described below

commit 96d1635f98d0cfd5b0cd01115bb738e1c6053b94
Author: Stamatis Zampetakis <[email protected]>
AuthorDate: Thu Sep 18 10:38:29 2025 +0200

    HIVE-29196: Apply and report checkstyle issues via Sonarqube (#6076)
---
 Jenkinsfile | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/Jenkinsfile b/Jenkinsfile
index 692b6773a16..c2da8e93e9a 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -117,6 +117,7 @@ def sonarAnalysis(args) {
       -Dsonar.organization=apache \
       -Dsonar.projectKey=apache_hive \
       -Dsonar.host.url=https://sonarcloud.io \
+      -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml \
       """+args+" -DskipTests -Dit.skipTests -Dmaven.javadoc.skip"
 
       // Sonar scanner runs in a separate JVM so JAVA_OPTS (notably heap size)
@@ -193,6 +194,15 @@ def jobWrappers(closure) {
   }
 }
 
+def checkstyle() {
+  sh '''#!/bin/bash -e
+set -x
+sw java 21 && . /etc/profile.d/java.sh
+export MAVEN_OPTS="-Xmx6G"
+mvn checkstyle:checkstyle -Pitests
+'''
+}
+
 def saveWS() {
   sh '''#!/bin/bash -e
     tar --exclude=archive.tar -cf archive.tar .
@@ -342,6 +352,9 @@ tar -xzf packaging/target/apache-hive-*-nightly-*-src.tar.gz
               stage('Prepare') {
                   loadWS();
               }
+              stage('Checkstyle') {
+                  checkstyle()
+              }
               stage('Sonar') {
                   sonarAnalysis("-Dsonar.branch.name=${BRANCH_NAME}")
               }
@@ -349,6 +362,9 @@ tar -xzf packaging/target/apache-hive-*-nightly-*-src.tar.gz
               stage('Prepare') {
                   loadWS();
               }
+              stage('Checkstyle') {
+                  checkstyle()
+              }
               stage('Sonar') {
                   
sonarAnalysis("""-Dsonar.pullrequest.github.repository=apache/hive \
                                    -Dsonar.pullrequest.key=${CHANGE_ID} \

Reply via email to