start-dev.sh
852 字节
#!/bin/bash
# SMF Core 开发服务器启动脚本
# 此脚本用于启动开发环境的应用服务器
# 错误时退出
set -e
echo "========================================"
echo "启动 SMF Core 开发服务器"
echo "========================================"
# 项目根目录
PROJECT_ROOT=$(dirname "$(dirname "$0")")
cd "$PROJECT_ROOT"
# 检查是否已编译
if [ ! -d "target/classes" ]; then
echo "检测到项目尚未编译,正在编译..."
mvn compile
fi
echo "\n启动开发服务器..."
echo "使用配置: application-dev.yml"
echo "访问地址: http://localhost:8080/smf-core"
echo "H2 控制台: http://localhost:8080/smf-core/h2-console"
echo "\n按 Ctrl+C 停止服务器"
echo "========================================"
# 使用 Spring Boot Maven 插件运行应用
mvn spring-boot:run -Dspring-boot.run.profiles=dev