generated from arafkarsh/ms-springboot-324-java-22-jakarta-ee-10
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathrun
executable file
·24 lines (21 loc) · 1006 Bytes
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
# -------------------------------------------------------------------------------------------
# @author: Araf Karsh Hamid
# -------------------------------------------------------------------------------------------
echo "Starting `getServiceName` Microservice"
export JDK_JAVA_OPTIONS="--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED"
runMode=$1
# Check if the runMode is null or not one of "dev", "prod", or "staging"
if [[ -z $runMode || ($runMode != "dev" && $runMode != "prod" && $runMode != "staging") ]]
then
runMode="dev"
fi
echo "App running with profile = $runMode"
# Run Maven Command
# mvn spring-boot:run -Dspring-boot.run.profiles=$runMode
# Run Java command
echo "java -jar target/ms-vanilla-service-*-spring-boot.jar --spring.profiles.active=$runMode"
java -Xms64m -Xmx64m -jar target/ms-vanilla-service-*-spring-boot.jar \
--spring.profiles.active=$runMode \
-Djava.security.manager=java.lang.SecurityManager \
-Djava.security.policy=./vanilla.policy