From: Eric Ball Date: Tue, 13 Jan 2026 02:19:53 +0000 (-0800) Subject: Fix: Switch maven-build vars to double quotes X-Git-Tag: v0.92.11^0 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=9a80001af1fb6efb6cbdb21340fc07a89c829005;p=releng%2Fglobal-jjb.git Fix: Switch maven-build vars to double quotes The previous fix had the $WORKSPACE env var in a single-quoted string, causing it not to expand when run. This was causing builds to be put in a directory with the literal name '$WORKSPACE' rather than the actual Jenkins workspace. Issue: IT-29164 Change-Id: I2055a32a82d282d1c130d2d09fc0819da8b127a3 Signed-off-by: Eric Ball --- diff --git a/releasenotes/notes/fix-maven-build-quotes-cc42f697184a42f0.yaml b/releasenotes/notes/fix-maven-build-quotes-cc42f697184a42f0.yaml new file mode 100644 index 00000000..562055c5 --- /dev/null +++ b/releasenotes/notes/fix-maven-build-quotes-cc42f697184a42f0.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + The previous fix had an environment variable contained in single quotes, + causing it to not to expand when run. Putting the entire string into double + quotes solves the issue while maintaining the validity of the string. diff --git a/shell/maven-build.sh b/shell/maven-build.sh index d4b2dddd..6829d100 100644 --- a/shell/maven-build.sh +++ b/shell/maven-build.sh @@ -24,15 +24,9 @@ plugin_version=$($MVN help:describe -Dplugin=org.apache.maven.plugins:maven-depl | grep "^Version:" | awk '{print $2}' || echo "2.8.2") if [[ "${plugin_version%%.*}" -lt 3 ]]; then # Compare only major version number - # Disable SC2016 because we don't want $WORKSPACE to be expanded here. - # shellcheck disable=SC2016 - alt_repo='-DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo' + alt_repo="-DaltDeploymentRepository=staging::default::file:$WORKSPACE/m2repo" else - # Disable SC2016 because we don't want $WORKSPACE to be expanded here. - # shellcheck disable=SC2016 - # Disable SC2089 because the embedded quotes are intentional. - # shellcheck disable=SC2089 - alt_repo='-DaltDeploymentRepository=staging::file:"$WORKSPACE"/m2repo' + alt_repo="-DaltDeploymentRepository=staging::file:$WORKSPACE/m2repo" fi export MAVEN_OPTS