Skip to content

Commit 491afe9

Browse files
committed
Starting spring boot with parameters
1 parent 49bbebf commit 491afe9

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

EasyKey.maven/ezk-maven-functions.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
#!/bin/bash
22

3+
useFull() {
4+
echo "Validate JPA Entities on startup"
5+
echo "spring.jpa.hibernate.ddl-auto=validate"
6+
echo "Generate and log statistics"
7+
echo "spring.jpa.properties.hibernate.generate_statistics=true"
8+
echo "logging.level.org.hibernate.stat=DEBUG"
9+
# Log slow queries
10+
echo "spring.jpa.properties.hibernate.session.events.log.LOG_QUERIES_SLOWER_THAN_MS=1"
11+
# Log all SQL statements
12+
echo "logging.level.org.hibernate.SQL=DEBUG"
13+
# Log cache operations
14+
echo "logging.level.org.hibernate.cache=DEBUG"
15+
}
16+
317
enableLogging() {
418
echo "Root logger (global default logging level):"
519
echo "logging.level.root=warn"
@@ -54,9 +68,8 @@ mvnCleanEclipse(){
5468
}
5569

5670
startSpringBoot() {
57-
echo "Which profile? (optional)"
71+
echo "Which profile?"
5872
read defprofiles
59-
defprofiles=-Dspring-boot.run.profiles=${defprofiles}
6073
my_array=("logging.level.web=DEBUG" \
6174
"logging.level.sql=DEBUG" \
6275
"logging.level.web=TRACE" \
@@ -65,7 +78,7 @@ startSpringBoot() {
6578
concatenated=$(printf "%s\n" "${my_array[@]}")
6679
selectItem 'printf "%s\n" "${my_array[@]}"' "awk '{print \$1}'"
6780
if [[ $fname == "" ]]; then return 0; fi
68-
mvn spring-boot:run -Dspring-boot.run.arguments=--"$fname" ${defprofiles}
81+
executeCommand "SPRING_PROFILES_ACTIVE="$defprofiles" mvn spring-boot:run -Dspring-boot.run.arguments=--"$fname""
6982
}
7083

7184
showGlobalSettings(){

EasyKey.maven/maven.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ menuInit "Super MAVEN Home"
2424
menuItem D "Clean deploy" "mvn clean deploy -DskipTests"
2525
submenuHead "Spring-Boot:"
2626
menuItemClm o "Start Spring Boot App" startSpringBoot r "Enable logging" enableLogging
27-
menuItem s "View application properties" showProperties
27+
menuItemClm s "View application properties" showProperties v "Usefull notes" useFull
2828
startMenu

0 commit comments

Comments
 (0)