From 8ee8e5087a94a2d1ab9f728f7d2a8a730bb269af Mon Sep 17 00:00:00 2001 From: liningrui Date: Mon, 18 Feb 2019 14:06:22 +0800 Subject: [PATCH] Support customized plugin when init store Fix: #359 Change-Id: Iae7cb4694b2db22a187f74dc9b5408785e15806c --- hugegraph-dist/src/assembly/static/bin/init-store.sh | 11 ++++++++--- .../main/java/com/baidu/hugegraph/cmd/InitStore.java | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hugegraph-dist/src/assembly/static/bin/init-store.sh b/hugegraph-dist/src/assembly/static/bin/init-store.sh index ef6c3454a4..ea92fb0417 100755 --- a/hugegraph-dist/src/assembly/static/bin/init-store.sh +++ b/hugegraph-dist/src/assembly/static/bin/init-store.sh @@ -12,8 +12,13 @@ abs_path() { BIN=`abs_path` TOP="$(cd $BIN/../ && pwd)" -CONF=$TOP/conf -LIB=$TOP/lib +CONF="$TOP/conf" +LIB="$TOP/lib" +PLUGINS="$TOP/plugins" + +. ${BIN}/util.sh + +ensure_path_writable $PLUGINS if [ -n "$JAVA_HOME" ]; then JAVA="$JAVA_HOME"/bin/java @@ -25,5 +30,5 @@ cd $TOP echo "Initing HugeGraph Store..." -exec $JAVA -cp $LIB/hugegraph-dist-*.jar -Djava.ext.dirs=$LIB/ \ +exec $JAVA -cp $LIB/hugegraph-dist-*.jar -Djava.ext.dirs=$LIB:$PLUGINS \ com.baidu.hugegraph.cmd.InitStore $CONF/gremlin-server.yaml | grep "com.baidu.hugegraph" diff --git a/hugegraph-dist/src/main/java/com/baidu/hugegraph/cmd/InitStore.java b/hugegraph-dist/src/main/java/com/baidu/hugegraph/cmd/InitStore.java index 022822a18c..2142371e41 100644 --- a/hugegraph-dist/src/main/java/com/baidu/hugegraph/cmd/InitStore.java +++ b/hugegraph-dist/src/main/java/com/baidu/hugegraph/cmd/InitStore.java @@ -66,6 +66,7 @@ public static void main(String[] args) String confFile = args[0]; RegisterUtil.registerBackends(); + RegisterUtil.registerPlugins(); YamlConfiguration config = new YamlConfiguration(); config.load(confFile);