@echo off set "PROJECT_PATH=C:\dev\FPSMS-backend" set "SERVICE_NAME=FP-backend" echo. echo [1/4] Stopping service %SERVICE_NAME% ... net stop "%SERVICE_NAME%" >nul 2>&1 echo. echo [2/4] Waiting 5 seconds... timeout /t 5 >nul echo. echo [3/4] Building new JAR... cd /d "%PROJECT_PATH%" call gradlew clean bootJar --no-daemon if %errorlevel% neq 0 ( echo. echo Build FAILED! Service not restarted. timeout /t 10 exit /b 1 ) echo. echo [4/4] Starting service %SERVICE_NAME% ... net start "%SERVICE_NAME%" echo. echo SUCCESS! %SERVICE_NAME% is running with the new JAR! echo Deployment completed: %date% %time% echo Closing in 5 seconds... timeout /t 5 >nul