iotsaas/start-rule.bat
2995840376 0ce191c448 chore: 初始化 iotsaas 版本库基线
纳入范围:
- backend/  Spring Boot 多模块后端(iot-common/device/rule/data/alarm/auth)
- frontend/admin/  Vue3 + Element Plus 管理后台
- Android/   涂鸦原生 APP (com.xhai.iot)
- backend/sql/  Flyway 风格迁移脚本(V2~V21)
- docs/       对接文档与设计文档

排除范围:
- 构建产物: node_modules/ target/ build/ dist/ .gradle/
- 签名密钥: *.jks *.keystore (严禁入库)
- 本机配置: Android/local.properties
- 运行日志: logs/ *.log
- AI 协作本地数据 .codebuddy/ 与第三方 demo tuya-demo/

.gitattributes 统一以 LF 存储, Windows 批处理保留 CRLF
2026-10-27 12:00:41 +08:00

56 lines
1.6 KiB
Batchfile
Raw Permalink 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 IoT SaaS 规则引擎服务启动脚本 (Java 17)
echo ========================================
echo.
:: Java 17 路径
set JAVA17=C:\Program Files\Eclipse Adoptium\jdk-17.0.19.10-hotspot\bin\java.exe
:: 检查Java 17是否存在
if not exist "%JAVA17%" (
echo [错误] 找不到 Java 17: %JAVA17%
echo 请确认 JDK 17 已安装在此路径
pause
exit /b 1
)
:: 注意:iot-rule 的 spring-boot repackage 不带 exec classifier,
:: 产物名为 iot-rule-1.0.0.jar(约145MB fat jar),不是 iot-rule-1.0.0-exec.jar
set JAR_FILE=%~dp0backend\iot-rule\target\iot-rule-1.0.0.jar
:: 检查JAR文件是否存在
if not exist "%JAR_FILE%" (
echo [错误] 找不到JAR文件: %JAR_FILE%
echo 请先执行编译: mvn -f backend/pom.xml -pl iot-rule -am package -DskipTests
pause
exit /b 1
)
:: 检查9083端口是否被占用
netstat -ano | findstr ":9083.*LISTENING" >nul 2>&1
if %errorlevel%==0 (
echo [警告] 端口 9083 已被占用,尝试结束旧进程...
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":9083.*LISTENING"') do (
taskkill /F /PID %%a >nul 2>&1
)
timeout /t 2 /nobreak >nul
)
echo [信息] 使用Java版本:
"%JAVA17%" -version 2>&1 | findstr /i "version"
echo.
echo [信息] 启动规则引擎服务...
echo [信息] JAR文件: %JAR_FILE%
echo [信息] 监听端口: 9083
echo.
echo 按 Ctrl+C 停止服务
echo ========================================
echo.
:: 启动规则引擎
"%JAVA17%" -jar "%JAR_FILE%"
pause