Bazel: Enable Error-Prone by default

Enable Error-Prone by default, and also enable for core plugins.

Leave the checks severity as-is. This results in several warnings
being emitted during the build, but no errors. It is not intended
to clean up the warnings, but enabling the checks by default will
at least ensure that no new errors are introduced into the code.

Change-Id: I4fd0686519cb9d2531e5e05eee377ecba70e9293
diff --git a/.bazelrc b/.bazelrc
index 4a89eed..d6d4ce6 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -3,6 +3,7 @@
 build --experimental_strict_action_env
 build --action_env=PATH
 build --disk_cache=~/.gerritcodereview/bazel-cache/cas
+build --java_toolchain //tools:error_prone_warnings_toolchain
 
 test --build_tests_only
 test --test_output=errors
diff --git a/tools/BUILD b/tools/BUILD
index 7760b20..1017414 100644
--- a/tools/BUILD
+++ b/tools/BUILD
@@ -21,8 +21,10 @@
     visibility = ["//visibility:public"],
 )
 
-# This EP warnings list is based on:
+# Error Prone errors enabled by default; see ../.bazelrc for how this is
+# enabled. This warnings list is originally based on:
 # https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl
+# However, feel free to add any additional errors. Thus far they have all been pretty useful.
 java_package_configuration(
     name = "error_prone",
     javacopts = [
@@ -120,5 +122,11 @@
         "//gerrit-util-http/...",
         "//gerrit-util-ssl/...",
         "//gerrit-war/...",
+        "//plugins/commit-message-length-validator/...",
+        "//plugins/download-commands/...",
+        "//plugins/hooks/...",
+        "//plugins/replication/...",
+        "//plugins/reviewnotes/...",
+        "//plugins/singleusergroup/...",
     ],
 )