Make SONAR code coverage analysis work

Change-Id: I8091aea6127b78de404c986be74ecf44935ab92f
Issue-ID: DCAEGEN2-355
Signed-off-by: Andrew Gauld <ag1282@att.com>
diff --git a/mvn-phase-script.sh b/mvn-phase-script.sh
index 5fa716a..29290ca 100755
--- a/mvn-phase-script.sh
+++ b/mvn-phase-script.sh
@@ -33,10 +33,7 @@
     echo "MVN_NEXUSPROXY environment variable not set.  Cannot proceed"
     exit 1
 fi
-if [ -z "$SETTINGS_FILE" ]; then
-    echo "SETTINGS_FILE environment variable not set.  Cannot proceed"
-    exit 2
-fi
+export SETTINGS_FILE=${SETTINGS_FILE:-$HOME/.m2/settings.xml}
 
 set +e
 if ! wget -O ${PROJECT_ROOT}/mvn-phase-lib.sh \
@@ -86,9 +83,12 @@
   echo "==> test phase script"
   case $MVN_PROJECT_MODULEID in
   *)
-    set +e
-    run_tox_test
-    set -e
+    if [ -f tox.ini ]
+    then
+      set -e
+      run_tox_test
+      set +e
+    fi
     ;;
   esac
   ;;