run 492 Bytes
#!/bin/bash

set -e


if [ -d "target" ] ; then
    APP_TARGET=${APP_TARGET:-target}
elif   [ -d "build/libs" ] ; then #if needed #also: elif [new condition] 
    APP_TARGET=${APP_TARGET:-build/libs}
fi

echo "---> Starting Spring Boot application"
echo "--> # APP_TARGET = $APP_TARGET"
echo "--> # JAVA_OPTS = $JAVA_OPTS"
echo "---> Running application from standalone jar/war..."
java $JAVA_OPTS -jar `find $APP_TARGET -maxdepth 1 -regex ".*\(jar\|war\)"`
#java $JAVA_OPTS -jar $APP_TARGET