diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b79e74 --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# Maven +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties + +# Eclipse +.project +.classpath +.settings/ + +# IDEA +.idea +*.ipr +*.iml +*.iws + +# NetBeans +nb-configuration.xml + +# OSX +.DS_Store + +# VS Code +.vscode/ + +# formatter-maven-plugin +.cache/ \ No newline at end of file diff --git a/bash_completion.bash b/bash_completion.bash index d961eba..5e0e3fe 100755 --- a/bash_completion.bash +++ b/bash_completion.bash @@ -1,7 +1,7 @@ function_exists() { - declare -F $1 > /dev/null - return $? + declare -F $1 > /dev/null + return $? } function_exists _get_comp_words_by_ref || @@ -36,14 +36,14 @@ _get_comp_words_by_ref () function_exists __ltrim_colon_completions || __ltrim_colon_completions() { - if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then - # Remove colon-word prefix from COMPREPLY items - local colon_word=${1%${1##*:}} - local i=${#COMPREPLY[*]} - while [[ $((--i)) -ge 0 ]]; do - COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"} - done - fi + if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then + # Remove colon-word prefix from COMPREPLY items + local colon_word=${1%${1##*:}} + local i=${#COMPREPLY[*]} + while [[ $((--i)) -ge 0 ]]; do + COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"} + done + fi } function_exists __find_mvn_projects || @@ -61,25 +61,25 @@ __find_mvn_projects() } function_exists _realpath || -_realpath () +_realpath () { if [[ -f "$1" ]] then # file *must* exist if cd "$(echo "${1%/*}")" &>/dev/null then - # file *may* not be local - # exception is ./file.ext - # try 'cd .; cd -;' *works!* - local tmppwd="$PWD" - cd - &>/dev/null + # file *may* not be local + # exception is ./file.ext + # try 'cd .; cd -;' *works!* + local tmppwd="$PWD" + cd - &>/dev/null else - # file *must* be local - local tmppwd="$PWD" + # file *must* be local + local tmppwd="$PWD" fi else # file *cannot* exist - return 1 # failure + return 1 # failure fi # suppress shell session termination messages on macOS @@ -99,22 +99,22 @@ __pom_hierarchy() local pom=`_realpath "pom.xml"` POM_HIERARCHY+=("$pom") while [ -n "$pom" ] && grep -q "" "$pom"; do - ## look for a new relativePath for parent pom.xml + ## look for a new relativePath for parent pom.xml local parent_pom_relative=`grep -e ".*" "$pom" | sed 's/.*//' | sed 's/<\/relativePath>.*//g'` - ## is present but not defined, assume ../pom.xml - if [ -z "$parent_pom_relative" ]; then - parent_pom_relative="../pom.xml" - fi + ## is present but not defined, assume ../pom.xml + if [ -z "$parent_pom_relative" ]; then + parent_pom_relative="../pom.xml" + fi - ## if pom exists continue else break - parent_pom=`_realpath "${pom%/*}/$parent_pom_relative"` - if [ -n "$parent_pom" ]; then + ## if pom exists continue else break + parent_pom=`_realpath "${pom%/*}/$parent_pom_relative"` + if [ -n "$parent_pom" ]; then pom=$parent_pom - else - break + else + break fi - POM_HIERARCHY+=("$pom") + POM_HIERARCHY+=("$pom") done } @@ -200,7 +200,7 @@ _mvn() local options="-Dmaven.test.skip=true|-DskipTests|-DskipITs|-Dtest|-Dit.test|-DfailIfNoTests|-Dmaven.surefire.debug|-DenableCiProfile|-Dpmd.skip=true|-Dcheckstyle.skip=true|-Dtycho.mode=maven|-Dmaven.javadoc.skip=true|-Dgwt.compiler.skip|-Dcobertura.skip=true|-Dfindbugs.skip=true||-DperformRelease=true|-Dgpg.skip=true|-DforkCount" local profile_settings=`[ -e ~/.m2/settings.xml ] && grep -e "" -A 1 ~/.m2/settings.xml | grep -e ".*" | sed 's/.*//' | sed 's/<\/id>.*//g' | tr '\n' '|' ` - + local profiles="${profile_settings}|" for item in ${POM_HIERARCHY[*]} do