Commit 20b56ef9 authored by yuxiaodi's avatar yuxiaodi

init

parent 5274c301
# Ruoyi 项目 Makefile
APP_PORT = $(or $(APP_PORT_1),8000)
.PHONY: build clean test
......@@ -42,6 +43,23 @@ install:
@echo "所有模块依赖安装完成"
# 启动应用(依赖 install)
run:
run:
@echo "启动 ruoyi-admin 应用..."
cd ruoyi-admin && mvn -s /workspace/settings.xml spring-boot:run
cd /workspace/ruoyi-admin && mvn -s /workspace/settings.xml spring-boot:run &
@echo "应用已启动"
# 停止命令
.PHONY: stop
stop:
@echo "正在停止..."
@if command -v lsof >/dev/null 2>&1; then \
echo "使用 lsof 命令停止应用..."; \
lsof -ti:$(APP_PORT) | xargs kill -9 2>/dev/null || echo "没有找到运行在端口 $(APP_PORT) 的进程"; \
elif command -v ss >/dev/null 2>&1; then \
echo "使用 ss 命令停止应用..."; \
ss -ltnp | grep ':$(APP_PORT)' | awk '{print $7}' | sed 's/.*pid=\([0-9]*\).*/\1/' | xargs kill 2>/dev/null || echo "没有找到运行在端口 $(APP_PORT) 的进程"; \
else \
echo "❌ 错误:系统中没有找到 lsof 或 ss 命令"; \
exit 1; \
fi
@echo "✅ 系统已停止"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment