Files
starRiverProperty/maven-cw-elevator-application/scripts/verify_intelligent_cwoscomponent_nexus.sh
反编译工作区 e8672a3c7b fix: relocate cwos-portal decompiled output to correct path; remove nested directory
Former-commit-id: dc30d42a8c55ed8b2382a41dc2434233fbed9930
2026-04-29 12:09:48 +08:00

58 lines
2.6 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
# 校验私服上 intelligent-cwoscomponent 2.9.2 线是否「可解析」:父 POM、interface、rest 均存在,
# 且 rest 的 POM 必须声明对 intelligent-cwoscomponent-interface 的依赖(否则仅依赖 rest 时编译缺 client 包)。
#
# 环境变量:
# NEXUS_PUBLIC_BASE 默认 http://192.168.3.12:8081/repository/maven-public/
# ELEVATOR_ICOMP_VER 默认 2.9.2-xinghewan
# CURL_OPTS 追加传给 curl(如内网 Basic-u user:pass
#
# 退出码:0 校验通过;1 缺文件或 rest POM 不完整
set -euo pipefail
NEXUS_PUBLIC_BASE="${NEXUS_PUBLIC_BASE:-http://192.168.3.12:8081/repository/maven-public/}"
ICOMP_VER="${ELEVATOR_ICOMP_VER:-2.9.2-xinghewan}"
BASE="${NEXUS_PUBLIC_BASE%/}/"
die() { echo "ERROR: $*" >&2; exit 1; }
need_curl() { command -v curl >/dev/null 2>&1 || die "需要 curl"; }
fetch() {
local url="$1"
local out
if ! out="$(curl -sfL ${CURL_OPTS:-} "$url" 2>&1)"; then
echo "ERROR: 无法拉取: $url" >&2
echo "$out" >&2
exit 1
fi
printf '%s' "$out"
}
need_curl
G="cn/cloudwalk/intelligent"
PARENT_URL="${BASE}${G}/intelligent-cwoscomponent/${ICOMP_VER}/intelligent-cwoscomponent-${ICOMP_VER}.pom"
IFACE_POM_URL="${BASE}${G}/intelligent-cwoscomponent-interface/${ICOMP_VER}/intelligent-cwoscomponent-interface-${ICOMP_VER}.pom"
IFACE_JAR_URL="${BASE}${G}/intelligent-cwoscomponent-interface/${ICOMP_VER}/intelligent-cwoscomponent-interface-${ICOMP_VER}.jar"
REST_POM_URL="${BASE}${G}/intelligent-cwoscomponent-rest/${ICOMP_VER}/intelligent-cwoscomponent-rest-${ICOMP_VER}.pom"
REST_JAR_URL="${BASE}${G}/intelligent-cwoscomponent-rest/${ICOMP_VER}/intelligent-cwoscomponent-rest-${ICOMP_VER}.jar"
echo "==> NEXUS_PUBLIC_BASE=$NEXUS_PUBLIC_BASE"
echo "==> 检查父 POM: $PARENT_URL"
fetch "$PARENT_URL" >/dev/null
echo "==> 检查 interface POM + JAR"
fetch "$IFACE_POM_URL" >/dev/null
curl -sfL ${CURL_OPTS:-} -o /dev/null -I "$IFACE_JAR_URL" || die "interface JAR 不可访问: $IFACE_JAR_URL"
echo "==> 检查 rest POM + JAR"
rest_pom="$(fetch "$REST_POM_URL")"
curl -sfL ${CURL_OPTS:-} -o /dev/null -I "$REST_JAR_URL" || die "rest JAR 不可访问: $REST_JAR_URL"
if ! printf '%s' "$rest_pom" | grep -qE '<artifactId>intelligent-cwoscomponent-interface</artifactId>'; then
die "rest 的 POM 未声明 intelligent-cwoscomponent-interface(常见原因:deploy-file 未带 -DpomFileNexus 生成了空模型 POM)。请在 Nexus 删除该版本 rest 构件后,用 deploy_intelligent_cwoscomponent_to_nexus.sh 按 cw_lib 内 .pom 重新上传。"
fi
echo "OK: 私服 intelligent-cwoscomponent${ICOMP_VER})父 POM + interface + rest 齐全,且 rest POM 声明 interface。"