| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- @echo off
- echo Building and Running Chronic Disease App...
- 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...
- call mvn package
- if %errorlevel% neq 0 (
- echo Error: Build failed
- pause
- exit /b 1
- )
- echo Running application...
- java -jar target/ChronicDiseaseApp-1.0-SNAPSHOT.jar
|