Allow override of maven settings at instantiation 95/96695/2
authorjhh <jorge.hernandez-herrero@att.com>
Mon, 7 Oct 2019 20:40:23 +0000 (15:40 -0500)
committerjhh <jorge.hernandez-herrero@att.com>
Mon, 7 Oct 2019 22:46:53 +0000 (17:46 -0500)
Issue-ID: POLICY-2111
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: Ib7ec8beab2947fc9fbf55734d0412f444a963fe8
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
controlloop/packages/docker-controlloop/src/main/resources/docker-entrypoint.sh

index 8e968be..eeeeeb0 100644 (file)
 # ########################################################################
 
 
+function maven {
+    if [[ ${DEBUG} == y ]]; then
+        echo "-- ${FUNCNAME[0]} --"
+        set -x
+    fi
+
+    if [[ -f "${POLICY_INSTALL_INIT}"/settings.xml ]]; then
+        if ! cmp -s "${POLICY_INSTALL_INIT}"/settings.xml "${POLICY_HOME}"/etc/m2/settings.xml then
+            echo "overriding settings.xml"
+            cp -f "${POLICY_INSTALL_INIT}"/settings.xml "${POLICY_HOME}"/etc/m2
+        fi
+    fi
+
+    if [[ -f "${POLICY_INSTALL_INIT}"/standalone-settings.xml ]]; then
+        if ! cmp -s "${POLICY_INSTALL_INIT}"/standalone-settings.xml "${POLICY_HOME}"/etc/m2/standalone-settings.xml then
+            echo "overriding standalone-settings.xml"
+            cp -f "${POLICY_INSTALL_INIT}"/standalone-settings.xml "${POLICY_HOME}"/etc/m2
+        fi
+    fi
+}
+
 function configurations {
     if [[ ${DEBUG} == y ]]; then
         echo "-- ${FUNCNAME[0]} --"
@@ -205,6 +226,7 @@ function reload {
     fi
 
     configurations
+    maven
     features
     security
     properties