Update zookeeper to 3.8.2 and update dependencies

Update
- zookeeper to 3.8.2, versions < 3.7 are EOL [1]
- global-refdb to 3.7.4
- curator to 5.5.0
- netty-all to 4.1.94.Final
- jackson to 2.15.2
- testcontainers to 1.18.3
- docker-java to 3.3.2
- jna to 5.13.0

Previously there were 2 build targets to build the plugin for zookeeper
3.4 and 3.5. This was done in [2] to allow using 3.4 without ssl support
and 3.5 with ssl support in different installations. Since both these
versions are EOL since more than a year remove the second build target
and only provide a build for the latest zookeeper release 3.8.2.

Zookeeper release notes for 3.8.0 [3] state:

"ZooKeeper clients from 3.5.x onwards are fully compatible with 3.8.x
servers. The upgrade from 3.6.x and 3.7.x can be executed as usual, no
particular additional upgrade procedure is needed.
ZooKeeper 3.8.x clients are compatible with 3.5.x, 3.6.x and 3.7.x
servers as long as you are not using new APIs not present these
versions."

Running the zookeeper-refdb against a zookeeper 3.7.0 container
(defined in ZookeeperTestContainerSupport) succeeded.

While we are at it reformat the build files using buildifier.

[1] https://endoflife.date/zookeeper
[2] https://gerrit-review.googlesource.com/c/plugins/zookeeper-refdb/+/270620
[3] https://zookeeper.apache.org/releases.html

Change-Id: I2cceb9c7f3acf8df8cf4fb87323f5d89885ce919
diff --git a/BUILD b/BUILD
index 0751458..e7347bc 100644
--- a/BUILD
+++ b/BUILD
@@ -7,28 +7,6 @@
 )
 
 gerrit_plugin(
-    name = "zookeeper-refdb-zk-3.5",
-    srcs = glob(["src/main/java/**/*.java"]),
-    dir_name = "zookeeper-refdb",
-    manifest_entries = [
-        "Gerrit-PluginName: zookeeper-refdb",
-        "Gerrit-Module: com.googlesource.gerrit.plugins.validation.dfsrefdb.zookeeper.ZkValidationModule",
-        "Implementation-Title: zookeeper ref-db plugin",
-        "Implementation-URL: https://review.gerrithub.io/admin/repos/GerritForge/plugins_zookeeper",
-    ],
-    resources = glob(["src/main/resources/**/*"]),
-    deps = [
-        "@curator-client//jar",
-        "@curator-framework//jar",
-        "@curator-recipes//jar",
-        "@global-refdb//jar",
-        "@netty-all//jar",
-        "@zookeeper-jute_3.5//jar",
-        "@zookeeper_3.5//jar",
-    ],
-)
-
-gerrit_plugin(
     name = "zookeeper-refdb",
     srcs = glob(["src/main/java/**/*.java"]),
     manifest_entries = [
@@ -44,7 +22,9 @@
         "@curator-framework//jar",
         "@curator-recipes//jar",
         "@global-refdb//jar",
-        "@zookeeper_3.4//jar",
+        "@netty-all//jar",
+        "@zookeeper-jute//jar",
+        "@zookeeper//jar",
     ],
 )
 
@@ -66,20 +46,21 @@
     testonly = 1,
     visibility = ["//visibility:public"],
     exports = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [
-        ":zookeeper-refdb-zk-3.5__plugin",
+        ":zookeeper-refdb__plugin",
+        "@curator-client//jar",
         "@curator-framework//jar",
         "@curator-recipes//jar",
         "@curator-test//jar",
-        "@curator-client//jar",
-        "@jackson-annotations//jar",
-        "@jna//jar",
-        "@visible-assertions//jar",
         "@docker-java-api//jar",
+        "@docker-java-transport-zerodep//jar",
         "@docker-java-transport//jar",
         "@duct-tape//jar",
-        "@testcontainers//jar",
-        "@testcontainer-localstack//jar",
-        "@jackson-dataformat-cbor//jar",
+        "@jackson-annotations//jar",
         "@jackson-databind//jar",
+        "@jackson-dataformat-cbor//jar",
+        "@jna//jar",
+        "@testcontainer-localstack//jar",
+        "@testcontainers//jar",
+        "@visible-assertions//jar",
     ],
 )
diff --git a/external_plugin_deps.bzl b/external_plugin_deps.bzl
index 1a3fc2b..086580d 100644
--- a/external_plugin_deps.bzl
+++ b/external_plugin_deps.bzl
@@ -1,114 +1,117 @@
 load("//tools/bzl:maven_jar.bzl", "maven_jar")
 
 def external_plugin_deps():
-    CURATOR_VER = "4.2.0"
+    CURATOR_VER = "5.5.0"
 
     maven_jar(
         name = "curator-test",
         artifact = "org.apache.curator:curator-test:" + CURATOR_VER,
-        sha1 = "98ac2dd69b8c07dcaab5e5473f93fdb9e320cd73",
+        sha1 = "065586d87700aa29855e6aa566b210eadd1bb38d",
     )
 
     maven_jar(
         name = "curator-framework",
         artifact = "org.apache.curator:curator-framework:" + CURATOR_VER,
-        sha1 = "5b1cc87e17b8fe4219b057f6025662a693538861",
+        sha1 = "b706a216e49352103bd2527e83b1ec2410924494",
     )
 
     maven_jar(
         name = "curator-recipes",
         artifact = "org.apache.curator:curator-recipes:" + CURATOR_VER,
-        sha1 = "7f775be5a7062c2477c51533b9d008f70411ba8e",
+        sha1 = "4aa0cfb129c36cd91528fc1b8775705280e60285",
     )
 
     maven_jar(
         name = "curator-client",
         artifact = "org.apache.curator:curator-client:" + CURATOR_VER,
-        sha1 = "d5d50930b8dd189f92c40258a6ba97675fea3e15",
+        sha1 = "db2d83bdc0bac7b4f25fc113d8ce3eedc0a4e89c",
+    )
+
+    ZOOKEEPER_VER = "3.8.2"
+
+    maven_jar(
+        name = "zookeeper",
+        artifact = "org.apache.zookeeper:zookeeper:" + ZOOKEEPER_VER,
+        sha1 = "963e953f8e362fc3f253832876be2ae2dcde58d7",
     )
 
     maven_jar(
-        name = "zookeeper_3.5",
-        artifact = "org.apache.zookeeper:zookeeper:3.5.8",
-        sha1 = "fc0d02657ed5b26029daa50d7f98b9806a0b13af",
-    )
-
-    maven_jar(
-        name = "zookeeper-jute_3.5",
-        artifact = "org.apache.zookeeper:zookeeper-jute:3.5.8",
-        sha1 = "b399078f6ccfd6c258e42054091052e8f3e05824",
+        name = "zookeeper-jute",
+        artifact = "org.apache.zookeeper:zookeeper-jute:" + ZOOKEEPER_VER,
+        sha1 = "f644829e30004ff4a079c357c4bb34bf5aa5fb94",
     )
 
     maven_jar(
         name = "netty-all",
-        artifact = "io.netty:netty-all:4.1.48.Final",
-        sha1 = "ebb3666ba4883ba81920cec8ccb1a3adcc827eb1",
-    )
-
-    maven_jar(
-        name = "zookeeper_3.4",
-        artifact = "org.apache.zookeeper:zookeeper:3.4.14",
-        sha1 = "c114c1e1c8172a7cd3f6ae39209a635f7a06c1a1",
+        artifact = "io.netty:netty-all:4.1.94.Final",
+        attach_source = False,
+        sha1 = "2a7df0424eed81818157f22613f36b72487ceb34",
     )
 
     maven_jar(
         name = "global-refdb",
-        artifact = "com.gerritforge:global-refdb:3.6.0-rc3.1",
-        sha1 = "9e28fdc65dcdecefd852f6c24dd7eec339a01870",
+        artifact = "com.gerritforge:global-refdb:3.7.4",
+        sha1 = "a5f3fcdbc04b7e98c52ecd50d2a56424e60b0575",
     )
 
-    JACKSON_VER = "2.10.4"
+    JACKSON_VER = "2.15.2"
 
     maven_jar(
         name = "jackson-annotations",
         artifact = "com.fasterxml.jackson.core:jackson-annotations:" + JACKSON_VER,
-        sha1 = "6ae6028aff033f194c9710ad87c224ccaadeed6c",
+        sha1 = "4724a65ac8e8d156a24898d50fd5dbd3642870b8",
     )
 
     maven_jar(
         name = "jackson-core",
         artifact = "com.fasterxml.jackson.core:jackson-core:" + JACKSON_VER,
-        sha1 = "8796585e716440d6dd5128b30359932a9eb74d0d",
+        sha1 = "a6fe1836469a69b3ff66037c324d75fc66ef137c",
     )
 
     maven_jar(
         name = "jackson-dataformat-cbor",
         artifact = "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:" + JACKSON_VER,
-        sha1 = "c854bb2d46138198cb5d4aae86ef6c04b8bc1e70",
+        sha1 = "baafc85c70765594add14bd93f3efd68e1945b76",
     )
 
     maven_jar(
         name = "jackson-databind",
         artifact = "com.fasterxml.jackson.core:jackson-databind:" + JACKSON_VER,
-        sha1 = "76e9152e93d4cf052f93a64596f633ba5b1c8ed9",
+        sha1 = "9353b021f10c307c00328f52090de2bdb4b6ff9c",
     )
 
-    TESTCONTAINERS_VERSION = "1.15.3"
+    TESTCONTAINERS_VERSION = "1.18.3"
 
     maven_jar(
         name = "testcontainers",
         artifact = "org.testcontainers:testcontainers:" + TESTCONTAINERS_VERSION,
-        sha1 = "95c6cfde71c2209f0c29cb14e432471e0b111880",
+        sha1 = "a82f6258f92d50d278b9c67bdf5eabcaa5c08654",
     )
 
     maven_jar(
         name = "testcontainer-localstack",
         artifact = "org.testcontainers:localstack:" + TESTCONTAINERS_VERSION,
-        sha1 = "7aa69995bdaafb4b06e69fdab9bd98c4fddee43d",
+        sha1 = "2b7a8d4522330217545c4234b916b6b77f5c6f95",
     )
 
-    DOCKER_JAVA_VERS = "3.2.8"
+    DOCKER_JAVA_VERS = "3.3.2"
 
     maven_jar(
         name = "docker-java-api",
         artifact = "com.github.docker-java:docker-java-api:" + DOCKER_JAVA_VERS,
-        sha1 = "4ac22a72d546a9f3523cd4b5fabffa77c4a6ec7c",
+        sha1 = "0de6345d2f69638a224f73d9e62de83c7692e436",
     )
 
     maven_jar(
         name = "docker-java-transport",
         artifact = "com.github.docker-java:docker-java-transport:" + DOCKER_JAVA_VERS,
-        sha1 = "c3b5598c67d0a5e2e780bf48f520da26b9915eab",
+        sha1 = "a4c2cba248ccfefe9c5c8d8d4726f3e0b2b51104",
+    )
+
+    maven_jar(
+        name = "docker-java-transport-zerodep",
+        artifact = "com.github.docker-java:docker-java-transport-zerodep:" + DOCKER_JAVA_VERS,
+        sha1 = "36ef508e5e48613afb7fafbf7e89184243738e96",
     )
 
     maven_jar(
@@ -125,6 +128,6 @@
 
     maven_jar(
         name = "jna",
-        artifact = "net.java.dev.jna:jna:5.5.0",
-        sha1 = "0e0845217c4907822403912ad6828d8e0b256208",
+        artifact = "net.java.dev.jna:jna:5.13.0",
+        sha1 = "1200e7ebeedbe0d10062093f32925a912020e747",
     )
diff --git a/src/main/resources/Documentation/about.md b/src/main/resources/Documentation/about.md
index f3f6563..f6249d8 100644
--- a/src/main/resources/Documentation/about.md
+++ b/src/main/resources/Documentation/about.md
@@ -11,7 +11,7 @@
 
 ## Requirements
 
-Supported Zookeeper version is 3.5.x. For SSL connection minimal Zookeeper version is 3.5.1[ZOOKEEPER-2125](https://issues.apache.org/jira/browse/ZOOKEEPER-2125).
+Supported Zookeeper version is 3.8.x.
 
 ## Setup
 
diff --git a/src/test/java/com/googlesource/gerrit/plugins/validation/dfsrefdb/zookeeper/ZookeeperTestContainerSupport.java b/src/test/java/com/googlesource/gerrit/plugins/validation/dfsrefdb/zookeeper/ZookeeperTestContainerSupport.java
index 107ece9..366a83f 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/validation/dfsrefdb/zookeeper/ZookeeperTestContainerSupport.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/validation/dfsrefdb/zookeeper/ZookeeperTestContainerSupport.java
@@ -33,7 +33,7 @@
 public class ZookeeperTestContainerSupport {
 
   static class ZookeeperContainer extends GenericContainer<ZookeeperContainer> {
-    public static String ZOOKEEPER_VERSION = "3.5.5";
+    public static String ZOOKEEPER_VERSION = "3.8.2";
 
     public ZookeeperContainer() {
       super("zookeeper:" + ZOOKEEPER_VERSION);