Files
AIGC/demo/build-backend-for-baota.bat

45 lines
1.3 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
chcp 65001 >nul
echo ========================================
echo 后端打包脚本 - Windows
echo ========================================
echo.
echo [1/3] 清理旧的构建文件...
if exist target rmdir /s /q target
if exist backend-dist.zip del backend-dist.zip
echo.
echo [2/3] 使用Maven打包...
echo 这可能需要几分钟时间,请耐心等待...
call mvnw.cmd clean package -DskipTests
if %errorlevel% neq 0 (
echo 错误: Maven打包失败
pause
exit /b 1
)
echo.
echo ========================================
echo 打包完成!
echo ========================================
echo.
echo JAR包位置: target\demo-0.0.1-SNAPSHOT.jar
echo 文件大小:
dir target\demo-0.0.1-SNAPSHOT.jar | find "demo-0.0.1-SNAPSHOT.jar"
echo.
echo 部署到宝塔步骤:
echo 1. 上传 target\demo-0.0.1-SNAPSHOT.jar 到服务器(如:/www/server/aigc-backend/app.jar
echo 2. 在服务器创建 application-prod.properties 配置文件
echo 3. 在宝塔面板使用 Supervisor 或 Java项目管理器启动
echo.
echo 启动命令:
echo java -jar app.jar --spring.profiles.active=prod
echo.
echo 注意事项:
echo - 确保服务器已安装 Java 21 或更高版本
echo - 确保MySQL数据库已创建并配置
echo - 需要在服务器上创建 application-prod.properties 配置文件
echo.
pause