Bazel: Remove redundant plugin build boilerplate

Recent bazlets changes let gerrit_plugin() resolve Maven coordinates
passed through ext_deps against the default <plugin>_plugin_deps
repository.

They also let gerrit_plugin_tests() derive the default test target name,
wire the plugin under test, resolve external test dependencies from
ext_deps, and generate the runtime dependency checks when plugin is set.

Use those macro defaults in owners-common-api instead of spelling out
artifact() conversions and dependency test rules locally.

Change-Id: Idbae85352a6e1621de195896efd672219a2f7ab1
diff --git a/BUILD b/BUILD
index 9cba8c6..78ea426 100644
--- a/BUILD
+++ b/BUILD
@@ -3,73 +3,28 @@
     "gerrit_plugin",
     "gerrit_plugin_tests",
 )
-load("@rules_java//java:defs.bzl", "java_library")
-load("@rules_jvm_external//:defs.bzl", "artifact")
-load(
-    "@com_googlesource_gerrit_bazlets//tools:runtime_jars_allowlist.bzl",
-    "runtime_jars_allowlist_test",
-)
-load(
-    "@com_googlesource_gerrit_bazlets//tools:runtime_jars_overlap.bzl",
-    "runtime_jars_overlap_test",
-)
-load(
-    "@com_googlesource_gerrit_bazlets//tools:in_gerrit_tree.bzl",
-    "in_gerrit_tree_enabled",
-)
-
-EXT_REPO = "owners-common-api_plugin_deps"
-
-EXT_DEPS = [
-    "com.fasterxml.jackson.core:jackson-databind",
-    "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml",
-]
 
 PLUGIN = "owners-common-api"
 
 gerrit_plugin(
-    name = PLUGIN,
     srcs = glob([
         "src/main/java/**/*.java",
     ]),
+    ext_deps = [
+        "com.fasterxml.jackson.core:jackson-databind",
+        "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml",
+    ],
     manifest_entries = [
+        "Gerrit-PluginName: " + PLUGIN,
+        "Gerrit-Module: com.googlesource.gerrit.owners.api.OwnersApiModule",
         "Implementation-Title: Gerrit owners-common-api plugin",
         "Implementation-URL: https://gerrit.googlesource.com/plugins/owners",
-        "Gerrit-PluginName: owners-common-api",
-        "Gerrit-Module: com.googlesource.gerrit.owners.api.OwnersApiModule",
     ],
-    deps = [
-        artifact(
-            c,
-            repository_name = EXT_REPO,
-        )
-        for c in EXT_DEPS
-    ],
+    plugin = PLUGIN,
 )
 
 gerrit_plugin_tests(
-    name = "owners-common-api_tests",
     srcs = glob(["src/test/java/**/*.java"]),
+    ext_deps = ["org.easymock:easymock"],
     plugin = PLUGIN,
-    deps = [
-        artifact(
-            "org.easymock:easymock",
-            repository_name = EXT_REPO,
-        ),
-    ],
-)
-
-runtime_jars_allowlist_test(
-    name = "check_owners-common-api_third_party_runtime_jars",
-    allowlist = ":owners-common-api_third_party_runtime_jars.allowlist.txt",
-    hint = ":check_owners-common-api_third_party_runtime_jars_manifest",
-    target = ":owners-common-api__plugin",
-)
-
-runtime_jars_overlap_test(
-    name = "no_overlap_with_gerrit",
-    against = "//:release.war.jars.txt",
-    hint = "Exclude overlaps via maven.install(excluded_artifacts=[...]) and re-run this test.",
-    target = ":owners-common-api__plugin",
-    target_compatible_with = in_gerrit_tree_enabled(),
 )