| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- @echo off
- echo Building and Running Chronic Disease App...
- REM Switch to script directory to ensure Maven runs in project folder
- pushd "%~dp0"
- REM Check if Maven is installed
- where mvn >nul 2>nul
- if %errorlevel% neq 0 (
- echo Error: Maven is not installed or not in PATH
- pause
- exit /b 1
- )
- REM Kill any running Java processes
- echo Checking for running Java processes...
- tasklist | findstr java >nul 2>nul
- if %errorlevel% equ 0 (
- echo Found running Java processes. Attempting to terminate...
- taskkill /F /IM java.exe >nul 2>nul
- if %errorlevel% equ 0 (
- echo Successfully terminated Java processes.
- ) else (
- echo Warning: Failed to terminate some Java processes. Please check manually.
- )
- ) else (
- echo No running Java processes found.
- )
- echo Cleaning log directory...
- if exist logs (
- rmdir /s /q logs
- echo Log directory cleared.
- ) else (
- echo No log directory to clear.
- )
- echo Cleaning project...
- call mvn clean
- echo Building project...
- echo Building project (enable compiler parameters)...
- call mvn package -Dmaven.compiler.parameters=true
- if %errorlevel% neq 0 (
- echo Error: Build failed
- pause
- exit /b 1
- )
- echo Running application...
- echo Running application with JVM add-opens for java.lang.invoke...
- java --add-opens=java.base/java.lang.invoke=ALL-UNNAMED -jar target/ChronicDiseaseApp-1.0-SNAPSHOT.jar
- REM Return to original directory
- popd
|