diff --git a/Jenkinsfile b/Jenkinsfile index 559ee7d5678c7..ee19c59adbb08 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -133,7 +133,24 @@ pipeline { steps { cleanWs() sh 'rm -rvf /home/jenkins/.m2/repository/org/apache/camel' - checkout scm + script { + // Use full clone for JDK 21 on ubuntu-avx (needed for Sonar analysis) + // Use shallow clone for all other combinations + if ("${PLATFORM}" == "ubuntu-avx" && "${JDK_NAME}" == "jdk_21_latest") { + echo "Using full clone for ${PLATFORM}-${JDK_NAME} (required for code coverage and Sonar)" + checkout scm + } else { + echo "Using shallow clone for ${PLATFORM}-${JDK_NAME}" + checkout([ + $class: 'GitSCM', + branches: scm.branches, + extensions: [ + [$class: 'CloneOption', depth: 1, noTags: true, shallow: true] + ], + userRemoteConfigs: scm.userRemoteConfigs + ]) + } + } } } diff --git a/Jenkinsfile.jdk26 b/Jenkinsfile.jdk26 index c1eebb908eadf..36b23478cb074 100644 --- a/Jenkinsfile.jdk26 +++ b/Jenkinsfile.jdk26 @@ -96,7 +96,14 @@ pipeline { steps { cleanWs() sh 'rm -rvf /home/jenkins/.m2/repository/org/apache/camel' - checkout scm + checkout([ + $class: 'GitSCM', + branches: scm.branches, + extensions: [ + [$class: 'CloneOption', depth: 1, noTags: true, shallow: true] + ], + userRemoteConfigs: scm.userRemoteConfigs + ]) } }