From 22b6faee4493f32caf8b8193d4b74a79abbb6624 Mon Sep 17 00:00:00 2001 From: iadgovuser29 <33426478+iadgovuser29@users.noreply.github.com> Date: Tue, 7 May 2024 16:23:26 -0400 Subject: [PATCH] Added debug mode if boot war is selected --- package/linux/aca/aca_bootRun.sh | 23 ++++++++++++++--------- package/win/aca/aca_bootRun.ps1 | 20 ++++++++++++++------ 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/package/linux/aca/aca_bootRun.sh b/package/linux/aca/aca_bootRun.sh index ba761cb2..2d7d5f93 100755 --- a/package/linux/aca/aca_bootRun.sh +++ b/package/linux/aca/aca_bootRun.sh @@ -130,16 +130,21 @@ WEB_TLS_PARAMS="--server.ssl.key-store-password=$hirs_pki_password \ # uncomment to show spring boot and hibernate properties used as gradle arguments #echo "--args=\"$CONNECTOR_PARAMS $WEB_TLS_PARAMS\"" -if [ "$DEBUG_ACA" == YES ]; then - echo "Booting with debug mode..." - ./gradlew bootRun --args="--spring.config.location=$SPRING_PROP_FILE" -Pdebug -elif [ -z "$USE_WAR" ]; then +if [ -z "$USE_WAR" ]; then echo "Booting the ACA from local build..." - # ./gradlew bootRun --args="$CONNECTOR_PARAMS$WEB_TLS_PARAMS" -./gradlew bootRun --args="--spring.config.location=$SPRING_PROP_FILE" + if [ "$DEBUG_ACA" == YES ]; then + echo "... in debug" + ./gradlew bootRun --args="--spring.config.location=$SPRING_PROP_FILE" -Pdebug + else + ./gradlew bootRun --args="--spring.config.location=$SPRING_PROP_FILE" + fi else echo "Booting the ACA from a war file..." - # java -jar $WAR_PATH $CONNECTOR_PARAMS$WEB_TLS_PARAMS & -java -jar $WAR_PATH --spring.config.location=$SPRING_PROP_FILE & -exit 0 + if [ "$DEBUG_ACA" == YES ]; then + echo "... in debug" + java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:9123 -jar $WAR_PATH --spring.config.location=$SPRING_PROP_FILE & + else + java -jar $WAR_PATH --spring.config.location=$SPRING_PROP_FILE & + fi + exit 0 fi diff --git a/package/win/aca/aca_bootRun.ps1 b/package/win/aca/aca_bootRun.ps1 index 32184a36..1b6986ec 100644 --- a/package/win/aca/aca_bootRun.ps1 +++ b/package/win/aca/aca_bootRun.ps1 @@ -74,13 +74,21 @@ if (!$DEPLOYED_WAR) { } $SPRING_PROP_FILE_FORWARDSLASHES=($global:HIRS_DATA_SPRING_PROP_FILE | ChangeBackslashToForwardSlash) -if ($d -or $debug) { - echo "Booting with debug mode..." - ./gradlew bootRun --args="--spring.config.location=$SPRING_PROP_FILE" -Pdebug -elseif ($w -or $war) { +if ($w -or $war) { echo "Booting the ACA from a war file..." | WriteAndLog - java -jar $DEPLOYED_WAR --spring.config.location=$SPRING_PROP_FILE_FORWARDSLASHES + if ($d -or $debug) { + echo "... in debug" + java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:9123 -jar $DEPLOYED_WAR --spring.config.location=$SPRING_PROP_FILE_FORWARDSLASHES + } else { + java -jar $DEPLOYED_WAR --spring.config.location=$SPRING_PROP_FILE_FORWARDSLASHES + } } else { echo "Booting the ACA from local build..." | WriteAndLog - ./gradlew bootRun --args="--spring.config.location=$SPRING_PROP_FILE_FORWARDSLASHES" + if ($d -or $debug) { + echo "... in debug" + ./gradlew bootRun --args="--spring.config.location=$SPRING_PROP_FILE_FORWARDSLASHES" -Pdebug + } else { + ./gradlew bootRun --args="--spring.config.location=$SPRING_PROP_FILE_FORWARDSLASHES" + } + }