#!/usr/bin/env bash # 配置顺序:classpath(fat jar 内)→ 部署包解压的 BOOT-INF/classes(完整业务占位符) # → 本目录 application.properties(测试 MySQL/Redis、关 Consul)。 set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "$SCRIPT_DIR/../../../../" && pwd)" source "$REPO_ROOT/scripts/test-env/config/env.sh" 2>/dev/null || true JAR="$SCRIPT_DIR/../../target/ninca-common-component-organization-2.9.2-xinghewan.jar" JAVA_BIN="${JAVA_HOME:-/usr/lib/jvm/java-8-openjdk-amd64}/bin/java" DEPLOY_CLASSES="$REPO_ROOT/../部署包/ninca_common_component_organization_01-ninca_common_component_organization/ninca-common-component-organization-V2.9.2_20210730/BOOT-INF/classes" if [[ ! -d "$DEPLOY_CLASSES" ]]; then echo "Missing deployment sample classes dir: $DEPLOY_CLASSES" >&2 echo "Adjust DEPLOY_CLASSES in this script or unpack the deployment package." >&2 exit 1 fi if [[ ! -f "$JAR" ]]; then echo "Missing $JAR — run: mvn -pl cwos-component-organization-starter -am package -DskipTests" >&2 exit 1 fi exec "$JAVA_BIN" -jar "$JAR" \ --spring.config.location="classpath:/,classpath:/config/,file:${DEPLOY_CLASSES}/,file:${SCRIPT_DIR}/" \ --spring.cloud.bootstrap.location="file:${SCRIPT_DIR}/bootstrap.properties" \ --logging.config="file:${SCRIPT_DIR}/recognition-logback.xml" \ --spring.main.banner-mode=off \ "$@"