X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fmaven-sonar.sh;h=a2de475e97c65e04447cc2d89dd0cacf6b19e441;hb=d1e8579fac0f3a0aeba74f70b27a06ab3fdad54f;hp=9d13003281c136f435630327790c3d7a16dc8f33;hpb=657764a332291f18c045fea25887d92388172bc6;p=releng%2Fglobal-jjb.git diff --git a/shell/maven-sonar.sh b/shell/maven-sonar.sh index 9d130032..a2de475e 100644 --- a/shell/maven-sonar.sh +++ b/shell/maven-sonar.sh @@ -25,6 +25,7 @@ params+=("--settings $SETTINGS_FILE") # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. # shellcheck disable=SC2086 +# shellcheck disable=SC2048 _JAVA_OPTIONS="$JAVA_OPTS" $MVN $MAVEN_GOALS \ -e -Dsonar \ ${params[*]} \ @@ -48,14 +49,16 @@ if [ "$SONAR_HOST_URL" = "https://sonarcloud.io" ]; then fi fi -if [ "$SET_JDK_VERSION" != "$SONARCLOUD_JAVA_VERSION" ]; then +if [ -n "$SONARCLOUD_JAVA_VERSION" ] && [ "$SET_JDK_VERSION" != "$SONARCLOUD_JAVA_VERSION" ]; then export SET_JDK_VERSION="$SONARCLOUD_JAVA_VERSION" bash <(curl -s https://raw.githubusercontent.com/lfit/releng-global-jjb/master/shell/update-java-alternatives.sh) + # shellcheck source=/dev/null source /tmp/java.env fi # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters. # shellcheck disable=SC2086 +# shellcheck disable=SC2048 "$MVN" $SONAR_MAVEN_GOAL \ -e -Dsonar -Dsonar.host.url="$SONAR_HOST_URL" \ ${params[*]} \