Consume global-refdb directly from source

global-refdb is a pure Bazel build and can now be directly built
and consumed from source instead of downloading it from Maven
central.

Change-Id: I47c4021a073e95c4f92a6f7db5f5d8d755775377
Bug: Issue 297440085
diff --git a/BUILD b/BUILD
index 826ddef..4ab7117 100644
--- a/BUILD
+++ b/BUILD
@@ -18,10 +18,10 @@
     ],
     resources = glob(["src/main/resources/**/*"]),
     deps = [
+        ":global-refdb-neverlink",
         "@curator-client//jar",
         "@curator-framework//jar",
         "@curator-recipes//jar",
-        "@global-refdb//jar",
         "@netty-all//jar",
         "@zookeeper-jute_3.5//jar",
         "@zookeeper_3.5//jar",
@@ -40,10 +40,10 @@
     ],
     resources = glob(["src/main/resources/**/*"]),
     deps = [
+        ":global-refdb-neverlink",
         "@curator-client//jar",
         "@curator-framework//jar",
         "@curator-recipes//jar",
-        "@global-refdb//jar",
         "@zookeeper_3.4//jar",
     ],
 )
@@ -62,10 +62,17 @@
 )
 
 java_library(
+    name = "global-refdb-neverlink",
+    neverlink = 1,
+    exports = ["//plugins/global-refdb"],
+)
+
+java_library(
     name = "zookeeper-refdb__plugin_test_deps",
     testonly = 1,
     visibility = ["//visibility:public"],
     exports = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [
+        "//plugins/global-refdb",
         ":zookeeper-refdb-zk-3.5__plugin",
         "@curator-framework//jar",
         "@curator-recipes//jar",
diff --git a/Jenkinsfile b/Jenkinsfile
index 25b721e..459753c 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,2 +1,3 @@
 pluginPipeline(formatCheckId: 'gerritforge:zookeeper-refdb-format-8b1e7fb8ce34448cc425',
-               buildCheckId: 'gerritforge:zookeeper-refdb-8b1e7fb8ce34448cc425')
+               buildCheckId: 'gerritforge:zookeeper-refdb-8b1e7fb8ce34448cc425',
+               extraModules: [ 'global-refdb' ])
diff --git a/external_plugin_deps.bzl b/external_plugin_deps.bzl
index 2109189..65545b9 100644
--- a/external_plugin_deps.bzl
+++ b/external_plugin_deps.bzl
@@ -50,9 +50,3 @@
         artifact = "org.apache.zookeeper:zookeeper:3.4.14",
         sha1 = "c114c1e1c8172a7cd3f6ae39209a635f7a06c1a1",
     )
-
-    maven_jar(
-        name = "global-refdb",
-        artifact = "com.gerritforge:global-refdb:3.4.0",
-        sha1 = "a1c7b02ddabe0dd0a989fb30ca18b61fe95ee894",
-    )