#!/bin/bash
# SQL Server 2008 R2 兼容启动脚本
# Java 17 默认禁用了 TLSv1/TLSv1.1，SQL Server 2008 R2 需要这些协议

cd "$(dirname "$0")"

mkdir -p logs

echo "Starting hzhub-erp (SQL Server 2008 R2 compatible mode)..."

nohup mvn spring-boot:run \
  -Dspring-boot.run.profiles=dev \
  -Dspring-boot.run.jvmArguments="-Djava.security.properties=$(pwd)/override.security" \
  > logs/erp.log 2>&1 &

echo $! > logs/erp.pid
echo "hzhub-erp started with PID $(cat logs/erp.pid)"
echo "View logs with: tail -f logs/erp.log"
