Consume global-refdb from source instead of Maven

Change-Id: I4b798e367db3e493160e8cd49b37917ed75eb924
diff --git a/BUILD b/BUILD
index 01d9a2f..4f7e654 100644
--- a/BUILD
+++ b/BUILD
@@ -17,7 +17,7 @@
     ],
     resources = glob(["src/main/resources/**/*"]),
     deps = [
-        "@global-refdb//jar",
+        ":global-refdb-neverlink",
         "@google-cloud-spanner-with-dependencies//jar",
     ],
 )
@@ -51,11 +51,11 @@
     visibility = ["//visibility:public"],
     exports = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [
         ":spanner-refdb__plugin",
+        "//plugins/global-refdb",
         "@docker-java-api//jar",
         "@docker-java-transport-zerodep//jar",
         "@docker-java-transport//jar",
         "@duct-tape//jar",
-        "@global-refdb//jar",
         "@google-cloud-spanner-with-dependencies//jar",
         "@jackson-annotations//jar",
         "@jna//jar",
@@ -63,3 +63,9 @@
         "@testcontainers//jar",
     ],
 )
+
+java_library(
+    name = "global-refdb-neverlink",
+    neverlink = 1,
+    exports = ["//plugins/global-refdb"],
+)
diff --git a/Jenkinsfile b/Jenkinsfile
index efd67bf..0eec2c6 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,2 +1,3 @@
 pluginPipeline(formatCheckId: 'gerritforge:plugins-spanner-refdb-code-style',
-                buildCheckId: 'gerritforge:plugins-spanner-refdb-build-test')
+                buildCheckId: 'gerritforge:plugins-spanner-refdb-build-test',
+                extraModules: [ 'global-refdb' ])
diff --git a/README.md b/README.md
index 79efc58..eef7fb4 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,7 @@
 
 - Gerrit v3.6 or later
 - Cloud spanner as a provisioned instance
+- The global-refdb libModule
 - Optional, for testing: a locally hosted
 [emulator](https://cloud.google.com/spanner/docs/emulator)
 
diff --git a/external_plugin_deps.bzl b/external_plugin_deps.bzl
index f4bbcf2..bceefa1 100644
--- a/external_plugin_deps.bzl
+++ b/external_plugin_deps.bzl
@@ -7,12 +7,6 @@
         artifact = "com.google.cloud:google-cloud-spanner-jdbc:2.9.9:single-jar-with-dependencies",
     )
 
-    maven_jar(
-        name = "global-refdb",
-        sha1 = "00b6b0f39b3c8fc280a19d91fb0681954ebccd02",
-        artifact = "com.gerritforge:global-refdb:3.3.2.1",
-    )
-
     JACKSON_VER = "2.10.4"
 
     maven_jar(
diff --git a/src/main/resources/Documentation/build.md b/src/main/resources/Documentation/build.md
index 45b93cc..4695dbe 100644
--- a/src/main/resources/Documentation/build.md
+++ b/src/main/resources/Documentation/build.md
@@ -19,6 +19,10 @@
 gerrit/bazel-bin/plugins/@PLUGIN@/@PLUGIN@.jar
 ```
 
+The @PLUGIN@ plugin requires the global-refdb libModule to be available in
+the site/lib directory. Instructions for building the global-refdb libModule
+can be found [here](https://gerrit.googlesource.com/modules/global-refdb/).
+
 ## Eclipse project setup
 
 This project can be imported into the Eclipse IDE: