Files
hpd840321 7b2bd307f1 Initial commit: reorganized source tree
- backend/: 13 Maven modules (cw-elevator-application, cloudwalk-cloud, intelligent-cwoscomponent, ninca-crk, etc.)
- frontend/: 4 Vue projects (elevator-front, cwos-portal, alarm-front, front_acs) + decompiled + scripts
- scripts/: build, test-env, tools (Docker Compose, service templates, API parity)
- docs/: AGENTS.md, superpowers specs, architecture docs
- .gitignore: standard Java/Maven exclusions

Moved from legacy maven-*/ root layout to backend/ organized structure.
2026-05-09 09:56:45 +08:00

44 lines
2.0 KiB
Bash
Executable File
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.
#!/usr/bin/env bash
# 与当前目录下 application.properties 同路径启动 V1 历史包。
# 默认优先使用系统 JDK 8(避免 Conda 的 JDK17+ 触发 CGLIB 模块错误)。
# 若必须用当前环境的 JAVA_HOME ELEVATOR_USE_ENV_JAVA=1 ./run.sh
# 额外 JVM 参数: ELEVATOR_JAVA_OPTS="-Xmx512m" ./run.sh
set -euo pipefail
cd "$(dirname "$0")"
# shellcheck source=../common-java.sh
source "$(cd "$(dirname "$0")" && pwd)/../common-java.sh"
JAR="cw-elevator-application-V1.0.0.20211103.jar"
if [[ ! -f "$JAR" ]]; then
echo "缺少 $JAR,请在 deploy 目录执行: ./sync-jars.sh" >&2
exit 1
fi
_pick_java_home
if [[ ! -x "${JAVA_HOME}/bin/java" ]]; then
echo "ERROR: 未找到可执行的 JDK。请安装 openjdk-8-jdk,或设定 JAVA_HOME / ELEVATOR_USE_ENV_JAVA=1 ./run.sh(使用 Conda 等当前环境)。" >&2
exit 1
fi
JAVA="${JAVA_HOME}/bin/java"
OPEN_FLAGS=()
while IFS= read -r line; do
[[ -n "$line" ]] && OPEN_FLAGS+=("$line")
done < <(_jdk8_open_flags "$JAVA")
# classpath:/application.properties 最后加载会盖住外置 properties;用 merge-redis-json.sh 把 redis-override.properties
# 转成 SPRING_APPLICATION_JSON(含 host/port/password),优先级高于 jar。
# application-access-control.properties 与星中心生产门禁配置对齐,在 application 之后、redis-override 之前加载。
# 临时改密码:SPRING_REDIS_PASSWORD='其它' ./run.sh(含空字符串表示无密码)
if ! command -v python3 >/dev/null 2>&1; then
echo "需要 python3deploy/merge-redis-json.sh)。请安装 python3。" >&2
exit 1
fi
MERGE="$(cd "$(dirname "$0")" && pwd)/../merge-redis-json.sh"
if [[ ! -x "$MERGE" ]]; then
chmod +x "$MERGE" 2>/dev/null || true
fi
export SPRING_APPLICATION_JSON="$("$MERGE" "$PWD/redis-override.properties")"
# shellcheck disable=SC2086
exec "$JAVA" "${OPEN_FLAGS[@]}" ${ELEVATOR_JAVA_OPTS:-} -jar "$JAR" \
--spring.config.location=file:./application.properties,file:./application-access-control.properties,file:./redis-override.properties