55# ###############################################################################
66# api functions:
77#
8- # - java operation functions:
9- # - jvb::get_java_version
10- # - jvb::java_cmd
11- # - maven operation functions:
12- # - jvb::mvn_cmd
8+ # - mvu::mvn_cmd
139# ###############################################################################
1410#
1511# _ source guard begin _#
@@ -27,22 +23,22 @@ source "$__source_guard_364DF1B5_9CA2_44D3_9C62_CDF6C2ECB24F/common_utils.sh"
2723# maven operation functions
2824# ################################################################################
2925
30- readonly JVB_DEFAULT_MVN_OPTS =(
26+ readonly MVU_DEFAULT_MVN_OPTS =(
3127 -V --no-transfer-progress
3228)
3329
34- jvb ::_find_mvn_cmd_path () {
35- if [ -n " ${_JVB_MVN_PATH :- } " ]; then
36- echo " $_JVB_MVN_PATH "
30+ mvu ::_find_mvn_cmd_path () {
31+ if [ -n " ${_MVU_MVN_PATH :- } " ]; then
32+ echo " $_MVU_MVN_PATH "
3733 return
3834 fi
3935
4036 local -r maven_wrapper_name=" mvnw"
4137
4238 # 1. find the mvnw from project root dir
4339 if [[ -n " ${PROJECT_ROOT_DIR:- } " && -e " $PROJECT_ROOT_DIR /$maven_wrapper_name " ]]; then
44- _JVB_MVN_PATH =" $PROJECT_ROOT_DIR /$maven_wrapper_name "
45- echo " $_JVB_MVN_PATH "
40+ _MVU_MVN_PATH =" $PROJECT_ROOT_DIR /$maven_wrapper_name "
41+ echo " $_MVU_MVN_PATH "
4642 return
4743 fi
4844
@@ -51,8 +47,8 @@ jvb::_find_mvn_cmd_path() {
5147 while true ; do
5248 local mvnw_path=" $d /$maven_wrapper_name "
5349 [ -x " $mvnw_path " ] && {
54- _JVB_MVN_PATH =" $mvnw_path "
55- echo " $_JVB_MVN_PATH "
50+ _MVU_MVN_PATH =" $mvnw_path "
51+ echo " $_MVU_MVN_PATH "
5652 return
5753 }
5854
@@ -62,8 +58,8 @@ jvb::_find_mvn_cmd_path() {
6258
6359 # 3. find mvn from $PATH
6460 if command -v mvn & > /dev/null; then
65- _JVB_MVN_PATH =mvn
66- echo " $_JVB_MVN_PATH "
61+ _MVU_MVN_PATH =mvn
62+ echo " $_MVU_MVN_PATH "
6763 return
6864 fi
6965
@@ -76,41 +72,41 @@ jvb::_find_mvn_cmd_path() {
7672 ) "
7773}
7874
79- jvb ::mvn_cmd () {
75+ mvu ::mvn_cmd () {
8076 (( $# > 0 )) || cu::die " ${FUNCNAME[0]} requires arguments! But no provided"
8177
8278 # FIXME hard code logic for `DISABLE_GIT_DIRTY_CHECK`
83- cu::log_then_run " $( jvb ::_find_mvn_cmd_path) " \
84- " ${JVB_MVN_OPTS [@]} " \
79+ cu::log_then_run " $( mvu ::_find_mvn_cmd_path) " \
80+ " ${MVU_MVN_OPTS [@]} " \
8581 ${DISABLE_GIT_DIRTY_CHECK+-Dgit.dirty=false} \
8682 " $@ "
8783}
8884
89- jvb ::get_mvn_local_repository_dir () {
85+ mvu ::get_mvn_local_repository_dir () {
9086 (( $# == 0 )) || cu::die " ${FUNCNAME[0]} requires no arguments! But provided $# : $* "
9187
92- if [ -z " ${_JVB_MVN_LOCAL_REPOSITORY_DIR :- } " ]; then
93- echo " $_JVB_MVN_LOCAL_REPOSITORY_DIR "
88+ if [ -z " ${_MVU_MVN_LOCAL_REPOSITORY_DIR :- } " ]; then
89+ echo " $_MVU_MVN_LOCAL_REPOSITORY_DIR "
9490 fi
9591
96- _JVB_MVN_LOCAL_REPOSITORY_DIR =" $(
97- jvb ::mvn_cmd --no-transfer-progress help:evaluate -Dexpression=settings.localRepository |
92+ _MVU_MVN_LOCAL_REPOSITORY_DIR =" $(
93+ mvu ::mvn_cmd --no-transfer-progress help:evaluate -Dexpression=settings.localRepository |
9894 grep ' ^/'
9995 ) "
10096
101- [ -n " ${_JVB_MVN_LOCAL_REPOSITORY_DIR :- } " ] || cu::die " Fail to find maven local repository directory"
97+ [ -n " ${_MVU_MVN_LOCAL_REPOSITORY_DIR :- } " ] || cu::die " Fail to find maven local repository directory"
10298}
10399
104100# ###############################################################################
105101# auto run logic when source
106102# ###############################################################################
107103
108- jvb ::__auto_run_when_source () {
104+ mvu ::__auto_run_when_source () {
109105 # set VAR if absent
110106
111- if [ -z " ${JVB_MVN_OPTS [*]:- } " ]; then
112- JVB_MVN_OPTS =(" ${JVB_DEFAULT_MVN_OPTS [@]} " )
107+ if [ -z " ${MVU_MVN_OPTS [*]:- } " ]; then
108+ MVU_MVN_OPTS =(" ${MVU_DEFAULT_MVN_OPTS [@]} " )
113109 fi
114110}
115111
116- jvb ::__auto_run_when_source
112+ mvu ::__auto_run_when_source
0 commit comments