民意中心系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

44 lines
1.5 KiB

#!/usr/bin/env bash
# Installs the KingbaseES JDBC driver into the local Maven repository as
# cn.com.kingbase8:kingbase8:${KINGBASE8_VERSION:-8.6.0}
#
# The artifact is not published to Maven Central; use the jar shipped with your
# Kingbase server/client (often named like kingbase8-*.jar).
#
# If Maven cached a failed resolution, clear it first:
# rm -rf ~/.m2/repository/cn/com/kingbase8
#
# Usage:
# ./scripts/install-kingbase8-to-local-m2.sh /path/to/kingbase8-8.6.0.jar
# KINGBASE8_JAR=/path/to/kingbase8.jar KINGBASE8_VERSION=8.6.0 ./scripts/install-kingbase8-to-local-m2.sh
set -euo pipefail
JAR="${1:-${KINGBASE8_JAR:-}}"
if [[ -z "$JAR" || ! -f "$JAR" ]]; then
echo "Usage: $0 /path/to/kingbase8.jar" >&2
echo " or: KINGBASE8_JAR=/path/to/kingbase8.jar $0" >&2
exit 1
fi
VERSION="${KINGBASE8_VERSION:-8.6.0}"
if ! command -v mvn >/dev/null 2>&1; then
echo "mvn not found in PATH. Use IntelliJ bundled Maven or add Maven to PATH." >&2
exit 1
fi
mvn -q install:install-file \
-Dfile="$JAR" \
-DgroupId=cn.com.kingbase8 \
-DartifactId=kingbase8 \
-Dversion="$VERSION" \
-Dpackaging=jar
echo "Installed cn.com.kingbase8:kingbase8:${VERSION} from: $JAR"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
mkdir -p "$REPO_ROOT/sa-base/lib"
cp -f "$JAR" "$REPO_ROOT/sa-base/lib/kingbase8.jar"
echo "Also copied to $REPO_ROOT/sa-base/lib/kingbase8.jar (required for sa-admin system dependency / IDE run)"