+echo "----------------------------------------------------"
+echo "Downloading ONAP Maven XML for build process from oparent repo"
+echo "----------------------------------------------------"
+git clone "https://git.onap.org/oparent" $WORKSPACE/oparent
+cd $WORKSPACE/oparent
+# Check if a commitid parameter is given to specify a version of
+# oparent repository to checkout. If commitid is not provided, the
+# latest master version is used as default for backward
+# compatibility for existing ONAP jobs.
+set +o nounset
+if [[ -v ${MVN_SETTINGS_XML_VERSION} ]]; then
+ git checkout "${MVN_SETTINGS_XML_VERSION}"
+fi
+set -o nounset
+
+# if MVN_PARAMS set then use them otherwise default to ""
+LOCAL_MVN_PARAMS=""
+set +o nounset
+if [[ -n ${MVN_PARAMS} ]]; then
+ LOCAL_MVN_PARAMS=${MVN_PARAMS}
+fi
+set -o nounset
+
+# Copy Onap maven settings.xml to Jenkins home directory
+if [ ! -d /home/jenkins/.m2 ]; then
+ mkdir -p /home/jenkins/.m2/
+fi
+cp settings.xml /home/jenkins/.m2/settings.xml
+cd $WORKSPACE
+
+POMFILE="-f $WORKSPACE/pom.xml"
+set +o nounset
+if [[ -n ${SUBDIRECTORY} ]]; then
+ POMFILE="-f $WORKSPACE/$SUBDIRECTORY/pom.xml"
+ echo "Setting pom.xml to use to $POMFILE"
+fi
+set -o nounset
+