-
Notifications
You must be signed in to change notification settings - Fork 1
/
maven_example.sh
37 lines (33 loc) · 1.25 KB
/
maven_example.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
########################
# Maven example menu #
########################
# source shellmenu.sh
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$script_dir/shellmenu.sh"
# Just an arbitrary sample method called by shell menu
showGlobalSettingFile() {
OUTPUT="$(mvn -X | grep -F '[DEBUG] Reading global settings from')"
echo ${OUTPUT:37}
read -p "Open global settings? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
vim ${OUTPUT:37}
fi
}
clear
menuInit "Maven demo menu"
submenuHead "Life cycle commands "
menuItem c "Clean all" "mvn clean:clean"
menuItem x "Compile" "mvn clean compile"
menuItem t "Test" "mvn clean test"
menuItem i "Install" "mvn clean install"
submenuHead "Also usefull "
menuItem d "Analyze dependencies" "mvn dependency:analyze"
menuItem u "Clean compile force updates" "mvn clean compile -U -DskipTests"
menuItem e "Show effective settings" "mvn help:effective-settings"
menuItem r "Show local repo location" "mvn help:evaluate -Dexpression=settings.localRepository | grep -v '\[INFO\]'"
menuItem l "Show global settings file location" showGlobalSettingFile
startMenu "echo /Users"
echo "bye, bye, homie!"