11#! /bin/bash
22
3- # Script to flush Redis, build the project, and run Jetty
3+ # Script to flush Redis, build the project, and run both Jetty and http4s servers
44#
55# This script should be run from the OBP-API root directory:
66# cd /path/to/OBP-API
77# ./flushall_build_and_run.sh
8+ #
9+ # The http4s server will run in the background on port 8081
10+ # The Jetty server will run in the foreground on port 8080
811
912set -e # Exit on error
1013
@@ -27,4 +30,29 @@ echo "=========================================="
2730echo " Building and running with Maven..."
2831echo " =========================================="
2932export MAVEN_OPTS=" -Xss128m --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED"
30- mvn install -pl .,obp-commons && mvn jetty:run -pl obp-api
33+ mvn install -pl .,obp-commons
34+
35+ echo " "
36+ echo " =========================================="
37+ echo " Building http4s runner..."
38+ echo " =========================================="
39+ export MAVEN_OPTS=" -Xms3G -Xmx6G -XX:MaxMetaspaceSize=2G"
40+ mvn -pl obp-http4s-runner -am clean package -DskipTests=true -Dmaven.test.skip=true
41+
42+ echo " "
43+ echo " =========================================="
44+ echo " Starting http4s server in background..."
45+ echo " =========================================="
46+ java -jar obp-http4s-runner/target/obp-http4s-runner.jar > http4s-server.log 2>&1 &
47+ HTTP4S_PID=$!
48+ echo " http4s server started with PID: $HTTP4S_PID (port 8081)"
49+ echo " Logs are being written to: http4s-server.log"
50+ echo " "
51+ echo " To stop http4s server later: kill $HTTP4S_PID "
52+ echo " "
53+
54+ echo " =========================================="
55+ echo " Starting Jetty server (foreground)..."
56+ echo " =========================================="
57+ export MAVEN_OPTS=" -Xss128m --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED"
58+ mvn jetty:run -pl obp-api
0 commit comments