Add missing dependency on metrics-jmx

metrics-jmx was extracted in its own artifact and is not a part of
metrics-core any more. Add external dependency, and extend the
documentation.

Change-Id: I640041a67562aea5a2ad9a32f2fa804854829713
diff --git a/BUILD b/BUILD
index be554f4..1013c5e 100644
--- a/BUILD
+++ b/BUILD
@@ -3,8 +3,9 @@
 gerrit_plugin(
     name = "metrics-reporter-jmx",
     srcs = glob(["src/main/java/**/*.java"]),
-    resources = glob(["src/main/resources/**/*"]),
     manifest_entries = [
         "Gerrit-PluginName: metrics-reporter-jmx",
     ],
+    resources = glob(["src/main/resources/**/*"]),
+    deps = ["@metrics_jmx//jar"],
 )
diff --git a/external_plugin_deps.bzl b/external_plugin_deps.bzl
new file mode 100644
index 0000000..0db5af8
--- /dev/null
+++ b/external_plugin_deps.bzl
@@ -0,0 +1,8 @@
+load("//tools/bzl:maven_jar.bzl", "maven_jar")
+
+def external_plugin_deps():
+  maven_jar(
+    name = 'metrics_jmx',
+    artifact = 'io.dropwizard.metrics:metrics-jmx:4.0.2',
+    sha1 = 'c8c14f6d66100a6b79f5d4b6de1d50ccc7f627fb',
+  )
diff --git a/src/main/java/com/googlesource/gerrit/plugins/metricsreporters/GerritJmxReporter.java b/src/main/java/com/googlesource/gerrit/plugins/metricsreporters/GerritJmxReporter.java
index 2a9a3d7..cdfbb22 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/metricsreporters/GerritJmxReporter.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/metricsreporters/GerritJmxReporter.java
@@ -13,14 +13,13 @@
 // limitations under the License.
 package com.googlesource.gerrit.plugins.metricsreporters;
 
+import com.codahale.metrics.MetricRegistry;
+import com.codahale.metrics.jmx.JmxReporter;
 import com.google.gerrit.extensions.annotations.Listen;
 import com.google.gerrit.extensions.events.LifecycleListener;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
 
-import com.codahale.metrics.JmxReporter;
-import com.codahale.metrics.MetricRegistry;
-
 @Listen
 @Singleton
 public class GerritJmxReporter implements LifecycleListener {
diff --git a/src/main/resources/Documentation/build.md b/src/main/resources/Documentation/build.md
index 5262434..64ec61d 100644
--- a/src/main/resources/Documentation/build.md
+++ b/src/main/resources/Documentation/build.md
@@ -1,18 +1,34 @@
 Build
 =====
 
-This plugin is built with Bazel.
+This plugin is built with Bazel.  To install Bazel, follow
+the instruction on: https://www.bazel.io/versions/master/docs/install.html.
 
-Clone (or link) this plugin to the `plugins` directory of Gerrit's source tree.
+Clone (or link) this plugin to the `plugins` directory of Gerrit's
+source tree, and issue the command:
 
-Then issue
+```
+  git clone https://gerrit.googlesource.com/gerrit
+  git clone https://gerrit.googlesource.com/plugins/@PLUGIN@
+  cd gerrit/plugins
+  ln -s ../../@PLUGIN@ .
+```
+
+Put the external dependency Bazel build file into the Gerrit /plugins
+directory, replacing the existing empty one.
+
+```
+  cd gerrit/plugins
+  rm external_plugin_deps.bzl
+  ln -s @PLUGIN@/external_plugin_deps.bzl .
+```
+
+From Gerrit source tree issue the command:
 
 ```
   bazel build plugins/@PLUGIN@
 ```
 
-in the root of Gerrit's source tree to build
-
 The output is created in
 
 ```