#!/bin/bash
set -xeu -o pipefail
-BUNDLE_VERSION=$(xpath "${BUNDLE_POM}" '/project/version/text()' 2> /dev/null)
+# TODO: remove the second xpath command once the old version in CentOS 7 is not used any more
+BUNDLE_VERSION=$(xpath -e '/project/version/text()' "${BUNDLE_POM}" 2>/dev/null ||
+ xpath "${BUNDLE_POM}" '/project/version/text()' 2>/dev/null)
BUNDLEFOLDER="${KARAF_ARTIFACT}-${BUNDLE_VERSION}"
BUNDLE="${BUNDLEFOLDER}.zip"
BUNDLE_PATH="/tmp/r/org/opendaylight/${KARAF_PROJECT}/${KARAF_ARTIFACT}/${BUNDLE_VERSION}/${BUNDLE}"