[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/xdc0209/java-code/master/mavenDemo/mvn_source.sh [Back]  [Original]

#!/bin/bash

# ----------------------------- kiwi bash lib start -------------------------------------

# Make sure to execute this script with bash. Bash works well on suse, redhat, aix.##
# bashBashsuseredhataix##
[ -z "$BASH" ] && echo "Please use bash to run this script [ bash $0 ] or make sure the first line of this script [ $0 ] is [ #!/bin/bash ]." && exit 1

# Set the bash debug info style to pretty format. +[T: , L: , S: , F: ]##
# bash+[T: , L: , S: , F: ]##
[ -c /dev/stdout ] && export PS4_COLOR="32"
[ ! -c /dev/stdout ] && export PS4_COLOR=""
export PS4='+[$(debug_info=$(printf "T: %s, L:%3s, S: %s, F: %s" "$(date +%H%M%S)" "$LINENO" "$(basename $(cd $(dirname ${BASH_SOURCE[0]}) && pwd))/$(basename ${BASH_SOURCE[0]})" "$(for ((i=${#FUNCNAME[*]}-1; i>=0; i--)) do func_stack="$func_stack ${FUNCNAME[i]}"; done; echo $func_stack)") ; [ -z "$PS4_COLOR" ] && echo ${debug_info:0:94} ; [ -n "$PS4_COLOR" ] && echo -e "\e[${PS4_COLOR}m${debug_info:0:80}\e[0m")]: '

# bash $DEBUG_SWITCH subscript.sh##
# Save the debug state to invoke the subscript. Invoke the subscript example: bash $DEBUG_SWITCH subscript.sh##
(echo "${SHELLOPTS}" | grep -q "xtrace") && export DEBUG_SWITCH=-x

# Get the absolute path of this script.##
# ##
BASE_DIR=$(cd $(dirname $0) && pwd)
BASE_NAME=$(basename $0 .sh)

# ##
# Set the log file.##
log=$BASE_DIR/$BASE_NAME.log

function print_error()
{
    echo "[$(date "+%F %T")] ERROR: $*" | tee -a $log 1>&2
}

function print_info()
{
    echo "[$(date "+%F %T")] INFO: $*" | tee -a $log
}

function log_error()
{
    [ -n "$log" ] && echo "[$(date "+%F %T")] ERROR: $*" >>$log
}

function log_info()
{
    [ -n "$log" ] && echo "[$(date "+%F %T")] INFO: $*" >>$log
}

function die()
{
    print_error "$*"
    print_error "See log [ $log ] for details."
    exit 1
}

# ----------------------------- kiwi bash lib end ---------------------------------------

java_src=$BASE_DIR

echo "=============================================================================="
echo ": $java_src"
echo "=============================================================================="
echo

mvn source:jar -s $java_src/mvn_settings_linux.xml -f $java_src/com.xdc.soft/pom.xml            || exit 1
mvn source:jar -s $java_src/mvn_settings_linux.xml -f $java_src/com.xdc.soft.virgo/pom.xml      || exit 1
mvn source:jar -s $java_src/mvn_settings_linux.xml -f $java_src/com.xdc.soft.opensource/pom.xml || exit 1
mvn source:jar -s $java_src/mvn_settings_linux.xml -f $java_src/com.xdc.soft.mini/pom.xml       || exit 1
echo

echo "=============================================================================="
echo ": $java_src"
echo "=============================================================================="

Web Proxy Viewer  |  New URL  |  Original Page