Bazel: switch BUILD to native ext_deps support

Use native `ext_deps` support in `gerrit_plugin()` and
`gerrit_plugin_tests()` in the plugin BUILD file.

Declare external dependencies as Maven coordinates instead of generated
Bazel labels, and share common dependency through `EXT_DEPS`.

Change-Id: Ib35bcd7a84e64f6421fd9e2876020ccc0839a123
diff --git a/BUILD b/BUILD
index 99401ac..1a006fc 100644
--- a/BUILD
+++ b/BUILD
@@ -1,13 +1,19 @@
 load(
     "@com_googlesource_gerrit_bazlets//:gerrit_plugin.bzl",
     "gerrit_plugin",
-    "gerrit_plugin_dependency_tests",
     "gerrit_plugin_tests",
 )
 
+EXT_DEPS = [
+    "net.bull.javamelody:javamelody.core",
+    "org.jrobin:jrobin",
+]
+
+PLUGIN = "javamelody"
+
 gerrit_plugin(
-    name = "javamelody",
     srcs = glob(["src/main/java/**/*.java"]),
+    ext_deps = EXT_DEPS,
     manifest_entries = [
         "Gerrit-PluginName: javamelody",
         "Gerrit-Module: com.googlesource.gerrit.plugins.javamelody.Module",
@@ -15,22 +21,12 @@
         "Implementation-Title: Javamelody plugin",
         "Implementation-URL: https://gerrit-review.googlesource.com/#/admin/projects/plugins/javamelody",
     ],
+    plugin = PLUGIN,
     resources = glob(["src/main/resources/**/*"]),
-    deps = [
-        "@javamelody_plugin_deps//:net_bull_javamelody_javamelody_core",
-        "@javamelody_plugin_deps//:org_jrobin_jrobin",
-    ],
 )
 
 gerrit_plugin_tests(
-    name = "javamelody_tests",
     srcs = glob(["src/test/java/**/*.java"]),
-    tags = ["javamelody"],
-    deps = [
-        ":javamelody__plugin",
-        "@javamelody_plugin_deps//:net_bull_javamelody_javamelody_core",
-        "@javamelody_plugin_deps//:org_jrobin_jrobin",
-    ],
+    ext_deps = EXT_DEPS,
+    plugin = PLUGIN,
 )
-
-gerrit_plugin_dependency_tests(plugin = "javamelody")