mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-10 00:40:30 +08:00
7a7bf42165
Former-commit-id: 20071a784e3c5c1f8b392fd5ec8d44b500810359
33 lines
921 B
Bash
Executable File
33 lines
921 B
Bash
Executable File
#!/bin/bash
|
|
# build-elevator-v2.sh — 编译 cw-elevator-application V2
|
|
source "$(dirname "${BASH_SOURCE[0]}")/config/env.sh"
|
|
|
|
log_info "Building V2 elevator application..."
|
|
|
|
cd "$REPO_ROOT/maven-cw-elevator-application"
|
|
|
|
export JAVA_HOME
|
|
export PATH="$JAVA_HOME/bin:$PATH"
|
|
|
|
log_info "JDK: $($JAVA -version 2>&1 | head -1)"
|
|
|
|
# Build (skip tests)
|
|
$MVN clean install $MVN_OPTS 2>&1 | tail -5
|
|
|
|
if [[ ${PIPESTATUS[0]} -eq 0 ]]; then
|
|
log_ok "V2 elevator build SUCCESS"
|
|
else
|
|
log_error "V2 elevator build FAILED — check logs"
|
|
exit 1
|
|
fi
|
|
|
|
# Sync JAR to deploy/ — use wildcard to match any version
|
|
LATEST_JAR=$(ls -t cw-elevator-application-starter/target/cw-elevator-application-*.jar 2>/dev/null | grep -v sources | head -1)
|
|
if [[ -n "$LATEST_JAR" ]]; then
|
|
cp "$LATEST_JAR" deploy/v2-maven/
|
|
log_ok "JAR synced: $(basename "$LATEST_JAR") → deploy/v2-maven/"
|
|
else
|
|
log_error "No JAR found in target/"
|
|
exit 1
|
|
fi
|