This commit is contained in:
wfz
2026-04-15 20:58:16 +08:00
commit 8ab9a9fa70
33 changed files with 6140 additions and 0 deletions

35
backend/build-and-run.bat Normal file
View File

@@ -0,0 +1,35 @@
@echo off
echo ========================================
echo Zombie Crisis 3 - Build and Run Script
echo ========================================
echo.
set MAVEN_VERSION=3.9.6
set MAVEN_DIR=%~dp0.maven
if not exist "%MAVEN_DIR%\apache-maven-%MAVEN_VERSION%" (
echo Maven not found. Downloading Maven %MAVEN_VERSION%...
powershell -Command "Invoke-WebRequest -Uri 'https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/%MAVEN_VERSION%/apache-maven-%MAVEN_VERSION%-bin.zip' -OutFile '%MAVEN_DIR%\maven.zip'"
if not exist "%MAVEN_DIR%" mkdir "%MAVEN_DIR%"
echo Extracting Maven...
powershell -Command "Expand-Archive -Path '%MAVEN_DIR%\maven.zip' -DestinationPath '%MAVEN_DIR%' -Force"
del "%MAVEN_DIR%\maven.zip"
)
set MAVEN_HOME=%MAVEN_DIR%\apache-maven-%MAVEN_VERSION%
set PATH=%MAVEN_HOME%\bin;%PATH%
echo Building server...
call mvn clean package -DskipTests
if %ERRORLEVEL% NEQ 0 (
echo Build failed!
pause
exit /b 1
)
echo.
echo Starting server on port 8080...
java -jar target\zombie-crisis-server-1.0.0.jar
pause