Skip to content

Commit 919919c

Browse files
committed
Added maven menu
1 parent 2b45a99 commit 919919c

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/bin/bash
2+
3+
mvnCleanEclipse(){
4+
mvn clean:clean
5+
mvn eclipse:clean
6+
mvn eclipse:eclipse
7+
}
8+
9+
startSpringBoot() {
10+
echo "Which profile? (optional)"
11+
read defprofiles
12+
if [ "$defprofiles" = "" ]; then
13+
mvn spring-boot:run
14+
else
15+
mvn spring-boot:run -Dspring-boot.run.profiles=$defprofiles
16+
fi
17+
}
18+
19+
showGlobalSettings(){
20+
OUTPUT="$(mvn -X | grep -F '[DEBUG] Reading global settings from')"
21+
echo ${OUTPUT:37}
22+
read -p "Open global settings? " -n 1 -r
23+
echo # (optional) move to a new line
24+
if [[ $REPLY =~ ^[Yy]$ ]]
25+
then
26+
vim ${OUTPUT:37}
27+
fi
28+
}
29+
30+
showLocalSettings() {
31+
OUTPUT="$(mvn -X | grep -F '[DEBUG] Reading user settings from')"
32+
echo ${OUTPUT:35}
33+
read -p "Open user settings? " -n 1 -r
34+
echo # (optional) move to a new line
35+
if [[ $REPLY =~ ^[Yy]$ ]]
36+
then
37+
vim ${OUTPUT:35}
38+
fi
39+
}
40+
41+
downLoadSources() {
42+
mvn dependency:sources
43+
mvn eclipse:eclipse -DdownloadSources=true
44+
}
45+
46+
toRepo() {
47+
repo=$(mvn help:evaluate -Dexpression=settings.localRepository | grep -v '\[INFO\]')
48+
cd "$repo"
49+
echo "Now in: $(pwd)"
50+
exit
51+
}
52+
53+
newProject() {
54+
echo "Command expects the user to be in the new cloned repo folder. <taste drücken>"
55+
read
56+
echo "Project name?"
57+
read projektname
58+
mvn archetype:generate -DartifactId=$projektname \
59+
-DinteractiveMode=true
60+
mv $projektname/* .
61+
rm -rf $projektname/
62+
mvn compile
63+
mvn eclipse:eclipse
64+
git status > .gitignore
65+
vim .gitignore
66+
break
67+
}

EasyKey.maven/maven.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
#####################################
4+
# EasyKey.maven utility main script #
5+
#####################################
6+
7+
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
8+
source "$script_dir/../shellmenu.sh"
9+
source "$script_dir/ezk-maven-functions.sh"
10+
11+
enableLogging() {
12+
echo "logging:"
13+
echo " level:"
14+
echo " org: "
15+
echo " springframework: "
16+
echo " test: "
17+
echo " context:"
18+
echo " jdbc: DEBUG"
19+
echo " jdbc:"
20+
echo " datasource:"
21+
echo " init: DEBUG"
22+
23+
echo "logging.level.org.springframework=DEBUG"
24+
echo "logging.level.com.myapp=DEBUG"
25+
26+
echo "org.springframework.boot.autoconfigure=DEBUG"
27+
}
28+
29+
menuInit "Super MAVEN Home"
30+
submenuHead "Maven:"
31+
menuItemClm a "Clean all eclipse" "mvnCleanEclipse" b "Maven analyze dependencies" "mvn dependency:analyze"
32+
menuItemClm c "Clean install force updates" "mvn clean install -U -DskipTests" d "To maven repo" toRepo
33+
menuItemClm e "Show effective settings" "mvn help:effective-settings" f "Local repo location" "mvn help:evaluate -Dexpression=settings.localRepository | grep -v '\[INFO\]'"
34+
menuItemClm g "Show global settings" showGlobalSettings h "Show local settings" showLocalSettings
35+
menuItemClm i "Re-resolve project dependencies" "mvn dependency:purge-local-repository" j "List repositories" "mvn dependency:list-repositories"
36+
menuItemClm k "Download sources" downLoadSources l "Build with deps" "mvn clean compile assembly:single"
37+
menuItemClm m "New project from archetype" newProject "p" "Effective pom" "mvn help:effective-pom"
38+
submenuHead "Spring-Boot:"
39+
menuItemClm o "Start Spring Boot App" startSpringBoot p "Enable logging" enableLogging
40+
startMenu

0 commit comments

Comments
 (0)