Fix build of protobuf-related components to support Bazel 0.22

- Bumped version of protobuf to 3.6.1.3 (includes fix for Bazel 0.22)
- Removed all protobuf and grpc dependencies from deps.json. Instead,
  depends solely on what's provided by the external grpc and protobuf
  workspaces.
- Use OSGi-wrapped protobuf and grpc JARs built with Bazel for runtime
- Add missing netty-related bundles to onos-thirdparty-base (required
by grpc)

Note, build with Bazel 0.22 is still broken because of
osgi_java_library.bzl, unless the following build arg is used:
build --incompatible_string_is_not_iterable=false

It seems the error is caused by dead code in osgi_java_library.bzl
that should be removed.

Change-Id: I749f1de25902bf9df5242444380f7224bc99b4b5
diff --git a/.bazelrc b/.bazelrc
index 42043be..75f7c1c 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -1,12 +1,7 @@
 build --nouse_ijars
 build --experimental_strict_action_env
-build --incompatible_package_name_is_a_function=false
-query --incompatible_package_name_is_a_function=false
-test --incompatible_package_name_is_a_function=false
-run --incompatible_package_name_is_a_function=false
 test --test_summary=terse
 test --test_output=errors
 test --test_verbose_timeout_warnings
-
 #build --disk_cache=~/bazel-cache
 #build --remote_http_cache=http://10.1.10.224:80/cache
diff --git a/apps/kafka-integration/BUILD b/apps/kafka-integration/BUILD
index 31e9ff2..86ddce2 100644
--- a/apps/kafka-integration/BUILD
+++ b/apps/kafka-integration/BUILD
@@ -1,6 +1,6 @@
 BUNDLES = [
     "@kafka_clients//jar",
-    "@runtime_protobuf//jar",
+    "//protocols/grpc:protobuf-java-bundle",
     "//core/protobuf/models:onos-core-protobuf-models",
     "//core/protobuf/models/proto:onos-core-protobuf-models-proto",
     "//apps/kafka-integration/api:onos-apps-kafka-integration-api",
diff --git a/apps/openstacktelemetry/BUILD b/apps/openstacktelemetry/BUILD
index 5bd1683..955df03 100644
--- a/apps/openstacktelemetry/BUILD
+++ b/apps/openstacktelemetry/BUILD
@@ -16,13 +16,13 @@
     "@simpleclient_hotspot//jar",
     "@simpleclient_servlet//jar",
     # gRPC dependencies (with patched core)
-    ":grpc-core-repkg",
-    "@runtime_grpc_stub//jar",
-    "@runtime_grpc_netty//jar",
-    "@runtime_grpc_auth//jar",
-    "@runtime_grpc_protobuf//jar",
-    "@runtime_grpc_protobuf_lite//jar",
-    "@runtime_protobuf//jar",
+    "//protocols/grpc:grpc-bundle-core",
+    "//protocols/grpc:grpc-bundle-stub",
+    "//protocols/grpc:grpc-bundle-netty",
+    "//protocols/grpc:grpc-bundle-auth",
+    "//protocols/grpc:grpc-bundle-protobuf",
+    "//protocols/grpc:grpc-bundle-protobuf-lite",
+    "//protocols/grpc:protobuf-java-bundle",
     "@com_google_api_grpc_proto_google_common_protos//jar",
     "@com_google_errorprone_error_prone_annotations//jar",
     "@com_google_auth_google_auth_library_credentials//jar",
@@ -44,10 +44,3 @@
     title = "OpenStack Telemetry Application",
     url = "https://wiki.onosproject.org/display/ONOS/SONA%3A+DC+Network+Virtualization",
 )
-
-wrapped_osgi_jar(
-    name = "grpc-core-repkg",
-    jar = "@io_grpc_grpc_java//core",
-    visibility = ["//visibility:public"],
-    deps = ["@io_opencensus_opencensus_api//jar"],
-)
diff --git a/lib/deps.json b/lib/deps.json
index 7f55443..c21f552 100644
--- a/lib/deps.json
+++ b/lib/deps.json
@@ -119,25 +119,6 @@
       "atomix-utils",
       "typesafe-config",
       "classgraph"
-    ],
-
-    // FIXME: Remove this for Bazel build
-    "GRPC_1.3": [
-      "grpc-protobuf-1.3.1",
-      "grpc-stub-1.3.1",
-      "grpc-netty-1.3.1",
-      "grpc-auth-1.3.1",
-      "grpc-context-1.3.1",
-      "google-truth-0.28"
-    ],
-    "GRPC_TEST_1.3": [
-      "grpc-testing-1.3.1",
-      "grpc-testing-proto-1.3.1",
-      "google-code-findbugs-3.0.0",
-      "google-errorprone-2.0.19",
-      "google-instrumentation-0.3.0",
-      "junit-dep",
-      "objenesis"
     ]
   },
 
@@ -341,33 +322,6 @@
     "stax2-api": "mvn:org.codehaus.woodstox:stax2-api:4.0.0",
     "concurrent-hashmap": "mvn:com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.0",
     "gnu-idn": "mvn:org.gnu.inet:libidn:1.15",
-    "sigar":"mvn:org.knowhowlab.osgi:sigar:1.6.5_01",
-
-    // Included merely for packaging purposes into run-time.
-    "runtime-grpc-core":"mvn:io.grpc:grpc-core:1.14.0",
-    "runtime-grpc-context":"mvn:io.grpc:grpc-context:1.14.0",
-    "runtime-grpc-stub":"mvn:io.grpc:grpc-stub:1.14.0",
-    "runtime-grpc-netty":"mvn:io.grpc:grpc-netty:1.14.0",
-    "runtime-grpc-auth":"mvn:io.grpc:grpc-auth:1.14.0",
-    "runtime-grpc-protobuf":"mvn:io.grpc:grpc-protobuf:1.14.0",
-    "runtime-grpc-protobuf-lite":"mvn:io.grpc:grpc-protobuf-lite:1.14.0",
-    "runtime-protobuf":"mvn:com.google.protobuf:protobuf-java:3.6.1",
-
-    // FIXME: Remove this for Bazel build...
-    "grpc-core-1.3.1": "mvn:io.grpc:grpc-core:1.3.1",
-    "grpc-protobuf-1.3.1": "mvn:io.grpc:grpc-protobuf:1.3.1",
-    "grpc-protobuf-lite-1.3.1": "mvn:io.grpc:grpc-protobuf-lite:1.3.1",
-    "grpc-stub-1.3.1": "mvn:io.grpc:grpc-stub:1.3.1",
-    "grpc-netty-1.3.1": "mvn:io.grpc:grpc-netty:1.3.1",
-    "grpc-auth-1.3.1": "mvn:io.grpc:grpc-auth:1.3.1",
-    "protobuf-java-3.3.0": "mvn:com.google.protobuf:protobuf-java:3.3.0",
-    "protobuf-java-3.2.0": "mvn:com.google.protobuf:protobuf-java:3.2.0",
-    "grpc-testing-1.3.1": "mvn:io.grpc:grpc-testing:1.3.1",
-    "grpc-testing-proto-1.3.1": "mvn:io.grpc:grpc-testing-proto:1.3.1",
-    "grpc-context-1.3.1": "mvn:io.grpc:grpc-context:1.3.1",
-    "google-truth-0.28": "mvn:com.google.truth:truth:0.28",
-    "google-code-findbugs-3.0.0": "mvn:com.google.code.findbugs:jsr305:3.0.0",
-    "google-errorprone-2.0.19": "mvn:com.google.errorprone:error_prone_annotations:2.0.19",
-    "google-instrumentation-0.3.0": "mvn:com.google.instrumentation:instrumentation-api:0.3.0"
+    "sigar":"mvn:org.knowhowlab.osgi:sigar:1.6.5_01"
   }
 }
diff --git a/protocols/gnmi/ctl/BUILD b/protocols/gnmi/ctl/BUILD
index db4cd44..9a7ee7c 100644
--- a/protocols/gnmi/ctl/BUILD
+++ b/protocols/gnmi/ctl/BUILD
@@ -3,7 +3,7 @@
     "//protocols/gnmi/stub:onos-protocols-gnmi-stub",
     "//protocols/grpc/api:onos-protocols-grpc-api",
     "//protocols/grpc/ctl:onos-protocols-grpc-ctl",
-    "//protocols/grpc:grpc-core-repkg",
+    "//protocols/grpc:grpc-bundle-core",
     "@com_google_protobuf//:protobuf_java",
     "@io_grpc_grpc_java//netty",
     "@io_grpc_grpc_java//protobuf-lite",
diff --git a/protocols/grpc/BUILD b/protocols/grpc/BUILD
index 26e178c..3d46f95 100644
--- a/protocols/grpc/BUILD
+++ b/protocols/grpc/BUILD
@@ -5,31 +5,19 @@
     "//protocols/grpc/api:onos-protocols-grpc-api",
     "//protocols/grpc/ctl:onos-protocols-grpc-ctl",
     # gRPC dependencies (with patched core)
-    ":grpc-core-repkg",
-    "@runtime_grpc_stub//jar",
-    "@runtime_grpc_netty//jar",
-    "@runtime_grpc_auth//jar",
-    "@runtime_grpc_protobuf//jar",
-    "@runtime_grpc_protobuf_lite//jar",
-    "@runtime_protobuf//jar",
+    ":grpc-bundle-core",
+    ":grpc-bundle-stub",
+    ":grpc-bundle-netty",
+    ":grpc-bundle-auth",
+    ":grpc-bundle-protobuf",
+    ":grpc-bundle-protobuf-lite",
+    ":protobuf-java-bundle",
     "@com_google_api_grpc_proto_google_common_protos//jar",
     "@com_google_errorprone_error_prone_annotations//jar",
     "@com_google_auth_google_auth_library_credentials//jar",
     "@io_opencensus_opencensus_api//jar",
     "@io_opencensus_opencensus_contrib_grpc_metrics//jar",
     "@com_google_code_gson_gson//jar",
-    # Lazily adding all netty-related packages.
-    # Some of them might not be necessary.
-    "@io_netty_netty//jar",
-    "@io_netty_netty_buffer//jar",
-    "@io_netty_netty_codec//jar",
-    "@io_netty_netty_codec_http//jar",
-    "@io_netty_netty_codec_http2//jar",
-    "@io_netty_netty_common//jar",
-    "@io_netty_netty_handler//jar",
-    "@io_netty_netty_transport//jar",
-    "@io_netty_netty_transport_native_epoll//jar",
-    "@io_netty_netty_resolver//jar",
 ]
 
 onos_app(
@@ -41,9 +29,64 @@
     url = "ttp://onosproject.org",
 )
 
+# Wrap protobuf and grpc-related JARs in OSGi-compatible ones, since the
+# original one are built with Bazel and NOT imported via mvn.
+
+# FIXME: consider moving these rules somewhere else as other apps depend on it
+#  (e.g. openstacktelemetry and kafka-integration) but they don't directly
+#  depend on any onos-protocols-grpc-* module.
+
 wrapped_osgi_jar(
-    name = "grpc-core-repkg",
+    # Differently from the official "grpc-core" package, here we also include
+    # "grpc-context" to solve the OSGI split-brain problem:
+    # https://github.com/grpc/grpc-java/issues/2727
+    # We use patched Bazel BUILD files to package together core and context (see
+    # tools/build/bazel/grpc_workspace.bzl). If you need grpc-context as a
+    # compile-time dependency, please use this one.
+    name = "grpc-bundle-core",
     jar = "@io_grpc_grpc_java//core",
     visibility = ["//visibility:public"],
-    deps = ["@io_opencensus_opencensus_api//jar"],
+    deps = [],
+)
+
+wrapped_osgi_jar(
+    name = "grpc-bundle-stub",
+    jar = "@io_grpc_grpc_java//stub",
+    visibility = ["//visibility:public"],
+    deps = [],
+)
+
+wrapped_osgi_jar(
+    name = "grpc-bundle-netty",
+    jar = "@io_grpc_grpc_java//netty",
+    visibility = ["//visibility:public"],
+    deps = [],
+)
+
+wrapped_osgi_jar(
+    name = "grpc-bundle-auth",
+    jar = "@io_grpc_grpc_java//auth",
+    visibility = ["//visibility:public"],
+    deps = [],
+)
+
+wrapped_osgi_jar(
+    name = "grpc-bundle-protobuf",
+    jar = "@io_grpc_grpc_java//protobuf",
+    visibility = ["//visibility:public"],
+    deps = [],
+)
+
+wrapped_osgi_jar(
+    name = "grpc-bundle-protobuf-lite",
+    jar = "@io_grpc_grpc_java//protobuf-lite",
+    visibility = ["//visibility:public"],
+    deps = [],
+)
+
+wrapped_osgi_jar(
+    name = "protobuf-java-bundle",
+    jar = "@com_google_protobuf//:protobuf_java",
+    visibility = ["//visibility:public"],
+    deps = [],
 )
diff --git a/protocols/p4runtime/ctl/BUILD b/protocols/p4runtime/ctl/BUILD
index 66aab43..5c9133d 100644
--- a/protocols/p4runtime/ctl/BUILD
+++ b/protocols/p4runtime/ctl/BUILD
@@ -5,7 +5,7 @@
     "//protocols/p4runtime/api:onos-protocols-p4runtime-api",
     "//protocols/p4runtime/proto:onos-protocols-p4runtime-proto",
     "@com_google_protobuf//:protobuf_java",
-    "//protocols/grpc:grpc-core-repkg",
+    "//protocols/grpc:grpc-bundle-core",
     "@io_grpc_grpc_java//netty",
     "@io_grpc_grpc_java//protobuf-lite",
     "@io_grpc_grpc_java//stub",
diff --git a/tools/build/bazel/generate_workspace.bzl b/tools/build/bazel/generate_workspace.bzl
index f449018..3dbd378 100644
--- a/tools/build/bazel/generate_workspace.bzl
+++ b/tools/build/bazel/generate_workspace.bzl
@@ -1,4 +1,4 @@
-# ***** This file was auto-generated at Sat, 19 Jan 2019 00:49:49 GMT. Do not edit this file manually. *****
+# ***** This file was auto-generated at Tue, 29 Jan 2019 22:50:52 GMT. Do not edit this file manually. *****
 # ***** Use onos-lib-gen *****
 
 load("//tools/build/bazel:variables.bzl", "ONOS_GROUP_ID", "ONOS_VERSION")
@@ -122,23 +122,6 @@
     "@typesafe_config//jar",
     "@classgraph//jar",
 ]
-GRPC_1_3 = [
-    "@grpc_protobuf_1_3_1//jar",
-    "@grpc_stub_1_3_1//jar",
-    "@grpc_netty_1_3_1//jar",
-    "@grpc_auth_1_3_1//jar",
-    "@grpc_context_1_3_1//jar",
-    "@google_truth_0_28//jar",
-]
-GRPC_TEST_1_3 = [
-    "@grpc_testing_1_3_1//jar",
-    "@grpc_testing_proto_1_3_1//jar",
-    "@google_code_findbugs_3_0_0//jar",
-    "@google_errorprone_2_0_19//jar",
-    "@google_instrumentation_0_3_0//jar",
-    "@junit_dep//jar",
-    "@objenesis//jar",
-]
 
 def generated_maven_jars():
     if "aopalliance_repackaged" not in native.existing_rules():
@@ -1281,144 +1264,6 @@
             jar_sha256 = "5107e6b19b1d0ff2cfcd3baf0c25f0d444330273b1f2bec710e127c733f11455",
             licenses = ["notice"],
             jar_urls = ["http://repo1.maven.org/maven2/org/knowhowlab/osgi/sigar/1.6.5_01/sigar-1.6.5_01.jar"],        )
-    if "runtime_grpc_core" not in native.existing_rules():
-        java_import_external(
-            name = "runtime_grpc_core",
-            jar_sha256 = "3b44ca22df91034dc8d2e3fc404a623e6cc662287b82d5f32d4e1cae1f30cefb",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-core/1.14.0/grpc-core-1.14.0.jar"],        )
-    if "runtime_grpc_context" not in native.existing_rules():
-        java_import_external(
-            name = "runtime_grpc_context",
-            jar_sha256 = "d70c10bdd12cd62ba4563d0b060c6db8d9d8e6593a87791a122633b0c4fd70cc",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-context/1.14.0/grpc-context-1.14.0.jar"],        )
-    if "runtime_grpc_stub" not in native.existing_rules():
-        java_import_external(
-            name = "runtime_grpc_stub",
-            jar_sha256 = "96629499c47340a16e6ddfac705b68aa90129c10dfa659a0750adf4b5f958fad",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-stub/1.14.0/grpc-stub-1.14.0.jar"],        )
-    if "runtime_grpc_netty" not in native.existing_rules():
-        java_import_external(
-            name = "runtime_grpc_netty",
-            jar_sha256 = "44fb5890b32d30079e33654d14719363e5c86ae762f8c00ae3d68ef52618291a",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-netty/1.14.0/grpc-netty-1.14.0.jar"],        )
-    if "runtime_grpc_auth" not in native.existing_rules():
-        java_import_external(
-            name = "runtime_grpc_auth",
-            jar_sha256 = "854e4069110c770c483d863fc62eb3c17d776c4b9d4b1f38494b6a39ae186aaa",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-auth/1.14.0/grpc-auth-1.14.0.jar"],        )
-    if "runtime_grpc_protobuf" not in native.existing_rules():
-        java_import_external(
-            name = "runtime_grpc_protobuf",
-            jar_sha256 = "58cfe955238e854caeba371093f70252eaf151a7c82c2849970f682b3e460f4f",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-protobuf/1.14.0/grpc-protobuf-1.14.0.jar"],        )
-    if "runtime_grpc_protobuf_lite" not in native.existing_rules():
-        java_import_external(
-            name = "runtime_grpc_protobuf_lite",
-            jar_sha256 = "083b4c678192461cdb1f46199de2ee5a6dd6c691fd8b1ae28c263de8aa219dd4",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-protobuf-lite/1.14.0/grpc-protobuf-lite-1.14.0.jar"],        )
-    if "runtime_protobuf" not in native.existing_rules():
-        java_import_external(
-            name = "runtime_protobuf",
-            jar_sha256 = "fb66d913ff0578553b2e28a3338cbbbe2657e6cfe0e98d939f23aea219daf508",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.6.1/protobuf-java-3.6.1.jar"],        )
-    if "grpc_core_1_3_1" not in native.existing_rules():
-        java_import_external(
-            name = "grpc_core_1_3_1",
-            jar_sha256 = "5f5988c616a56b25bf413fdf01fd63c107257fdbc4b23367a073e17552907821",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-core/1.3.1/grpc-core-1.3.1.jar"],        )
-    if "grpc_protobuf_1_3_1" not in native.existing_rules():
-        java_import_external(
-            name = "grpc_protobuf_1_3_1",
-            jar_sha256 = "36dc04e5d31ab6d6405a21eb5110f178bfa1ae481aaef8b8cb2fe8675a7344f0",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-protobuf/1.3.1/grpc-protobuf-1.3.1.jar"],        )
-    if "grpc_protobuf_lite_1_3_1" not in native.existing_rules():
-        java_import_external(
-            name = "grpc_protobuf_lite_1_3_1",
-            jar_sha256 = "300229b1cef817a44221471c8e171b56f167226acbf74fc7776c7a421ec13792",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-protobuf-lite/1.3.1/grpc-protobuf-lite-1.3.1.jar"],        )
-    if "grpc_stub_1_3_1" not in native.existing_rules():
-        java_import_external(
-            name = "grpc_stub_1_3_1",
-            jar_sha256 = "ca3b1b8e68d31d3b12b2d2b7a989e7f74653de07a9465957f4840dbb55b777a7",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-stub/1.3.1/grpc-stub-1.3.1.jar"],        )
-    if "grpc_netty_1_3_1" not in native.existing_rules():
-        java_import_external(
-            name = "grpc_netty_1_3_1",
-            jar_sha256 = "6c72f0a2db9d4a10bfd24588f3c36180535f46000217addd34280fdefdf290d2",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-netty/1.3.1/grpc-netty-1.3.1.jar"],        )
-    if "grpc_auth_1_3_1" not in native.existing_rules():
-        java_import_external(
-            name = "grpc_auth_1_3_1",
-            jar_sha256 = "432360b6d5d6cb998bf1e051f1f5e12e5c70b3e633c1579ccced2f0478e528f5",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-auth/1.3.1/grpc-auth-1.3.1.jar"],        )
-    if "protobuf_java_3_3_0" not in native.existing_rules():
-        java_import_external(
-            name = "protobuf_java_3_3_0",
-            jar_sha256 = "f3411ade77523d5f0d013d4f25c36879e66f0c5e1e4310f7096d54d0d2553554",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.3.0/protobuf-java-3.3.0.jar"],        )
-    if "protobuf_java_3_2_0" not in native.existing_rules():
-        java_import_external(
-            name = "protobuf_java_3_2_0",
-            jar_sha256 = "b1c2d420d2833429d11e405a58251e13bd7e3f22c266b49227c41e4d21361286",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.2.0/protobuf-java-3.2.0.jar"],        )
-    if "grpc_testing_1_3_1" not in native.existing_rules():
-        java_import_external(
-            name = "grpc_testing_1_3_1",
-            jar_sha256 = "d6c5a7ee5bb4d67608d7a8a01f7b8a95ab3f7d3df5d84e5aa5f61f90545f2dcd",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-testing/1.3.1/grpc-testing-1.3.1.jar"],        )
-    if "grpc_testing_proto_1_3_1" not in native.existing_rules():
-        java_import_external(
-            name = "grpc_testing_proto_1_3_1",
-            jar_sha256 = "5b52005cccdbdbf63c29e28aab13ab796509345cf306d819cd4118131dadc254",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-testing-proto/1.3.1/grpc-testing-proto-1.3.1.jar"],        )
-    if "grpc_context_1_3_1" not in native.existing_rules():
-        java_import_external(
-            name = "grpc_context_1_3_1",
-            jar_sha256 = "a644cb308edd21ebce57876052785f171735e0d04905e5ff20741d4642981e74",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/io/grpc/grpc-context/1.3.1/grpc-context-1.3.1.jar"],        )
-    if "google_truth_0_28" not in native.existing_rules():
-        java_import_external(
-            name = "google_truth_0_28",
-            jar_sha256 = "1037ded3a681c74ce020e306f136b24a51c09c95667d8eda9ffc8f8136294f71",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/com/google/truth/truth/0.28/truth-0.28.jar"],        )
-    if "google_code_findbugs_3_0_0" not in native.existing_rules():
-        java_import_external(
-            name = "google_code_findbugs_3_0_0",
-            jar_sha256 = "bec0b24dcb23f9670172724826584802b80ae6cbdaba03bdebdef9327b962f6a",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.0/jsr305-3.0.0.jar"],        )
-    if "google_errorprone_2_0_19" not in native.existing_rules():
-        java_import_external(
-            name = "google_errorprone_2_0_19",
-            jar_sha256 = "cde78ace21e46398299d0d9c6be9f47b7f971c7f045d40c78f95be9a638cbf7e",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.0.19/error_prone_annotations-2.0.19.jar"],        )
-    if "google_instrumentation_0_3_0" not in native.existing_rules():
-        java_import_external(
-            name = "google_instrumentation_0_3_0",
-            jar_sha256 = "671f7147487877f606af2c7e39399c8d178c492982827305d3b1c7f5b04f1145",
-            licenses = ["notice"],
-            jar_urls = ["http://repo1.maven.org/maven2/com/google/instrumentation/instrumentation-api/0.3.0/instrumentation-api-0.3.0.jar"],        )
 artifact_map = {}
 artifact_map["@aopalliance_repackaged//:aopalliance_repackaged"] = "mvn:org.glassfish.hk2.external:aopalliance-repackaged:jar:2.5.0-b42"
 artifact_map["@amqp_client//:amqp_client"] = "mvn:com.rabbitmq:amqp-client:jar:3.6.1"
@@ -1610,29 +1455,6 @@
 artifact_map["@concurrent_hashmap//:concurrent_hashmap"] = "mvn:com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:NON-OSGI:1.0"
 artifact_map["@gnu_idn//:gnu_idn"] = "mvn:org.gnu.inet:libidn:jar:NON-OSGI:1.15"
 artifact_map["@sigar//:sigar"] = "mvn:org.knowhowlab.osgi:sigar:jar:1.6.5_01"
-artifact_map["@runtime_grpc_core//:runtime_grpc_core"] = "mvn:io.grpc:grpc-core:jar:NON-OSGI:1.14.0"
-artifact_map["@runtime_grpc_context//:runtime_grpc_context"] = "mvn:io.grpc:grpc-context:jar:NON-OSGI:1.14.0"
-artifact_map["@runtime_grpc_stub//:runtime_grpc_stub"] = "mvn:io.grpc:grpc-stub:jar:NON-OSGI:1.14.0"
-artifact_map["@runtime_grpc_netty//:runtime_grpc_netty"] = "mvn:io.grpc:grpc-netty:jar:NON-OSGI:1.14.0"
-artifact_map["@runtime_grpc_auth//:runtime_grpc_auth"] = "mvn:io.grpc:grpc-auth:jar:NON-OSGI:1.14.0"
-artifact_map["@runtime_grpc_protobuf//:runtime_grpc_protobuf"] = "mvn:io.grpc:grpc-protobuf:jar:NON-OSGI:1.14.0"
-artifact_map["@runtime_grpc_protobuf_lite//:runtime_grpc_protobuf_lite"] = "mvn:io.grpc:grpc-protobuf-lite:jar:NON-OSGI:1.14.0"
-artifact_map["@runtime_protobuf//:runtime_protobuf"] = "mvn:com.google.protobuf:protobuf-java:jar:3.6.1"
-artifact_map["@grpc_core_1_3_1//:grpc_core_1_3_1"] = "mvn:io.grpc:grpc-core:jar:NON-OSGI:1.3.1"
-artifact_map["@grpc_protobuf_1_3_1//:grpc_protobuf_1_3_1"] = "mvn:io.grpc:grpc-protobuf:jar:NON-OSGI:1.3.1"
-artifact_map["@grpc_protobuf_lite_1_3_1//:grpc_protobuf_lite_1_3_1"] = "mvn:io.grpc:grpc-protobuf-lite:jar:NON-OSGI:1.3.1"
-artifact_map["@grpc_stub_1_3_1//:grpc_stub_1_3_1"] = "mvn:io.grpc:grpc-stub:jar:NON-OSGI:1.3.1"
-artifact_map["@grpc_netty_1_3_1//:grpc_netty_1_3_1"] = "mvn:io.grpc:grpc-netty:jar:NON-OSGI:1.3.1"
-artifact_map["@grpc_auth_1_3_1//:grpc_auth_1_3_1"] = "mvn:io.grpc:grpc-auth:jar:NON-OSGI:1.3.1"
-artifact_map["@protobuf_java_3_3_0//:protobuf_java_3_3_0"] = "mvn:com.google.protobuf:protobuf-java:jar:3.3.0"
-artifact_map["@protobuf_java_3_2_0//:protobuf_java_3_2_0"] = "mvn:com.google.protobuf:protobuf-java:jar:3.2.0"
-artifact_map["@grpc_testing_1_3_1//:grpc_testing_1_3_1"] = "mvn:io.grpc:grpc-testing:jar:NON-OSGI:1.3.1"
-artifact_map["@grpc_testing_proto_1_3_1//:grpc_testing_proto_1_3_1"] = "mvn:io.grpc:grpc-testing-proto:jar:NON-OSGI:1.3.1"
-artifact_map["@grpc_context_1_3_1//:grpc_context_1_3_1"] = "mvn:io.grpc:grpc-context:jar:NON-OSGI:1.3.1"
-artifact_map["@google_truth_0_28//:google_truth_0_28"] = "mvn:com.google.truth:truth:jar:NON-OSGI:0.28"
-artifact_map["@google_code_findbugs_3_0_0//:google_code_findbugs_3_0_0"] = "mvn:com.google.code.findbugs:jsr305:jar:NON-OSGI:3.0.0"
-artifact_map["@google_errorprone_2_0_19//:google_errorprone_2_0_19"] = "mvn:com.google.errorprone:error_prone_annotations:jar:NON-OSGI:2.0.19"
-artifact_map["@google_instrumentation_0_3_0//:google_instrumentation_0_3_0"] = "mvn:com.google.instrumentation:instrumentation-api:jar:NON-OSGI:0.3.0"
 
 def maven_coordinates(label):
     label_string = str(label)
diff --git a/tools/build/bazel/protobuf_workspace.bzl b/tools/build/bazel/protobuf_workspace.bzl
index 4a65eab..e850eb6 100644
--- a/tools/build/bazel/protobuf_workspace.bzl
+++ b/tools/build/bazel/protobuf_workspace.bzl
@@ -1,13 +1,13 @@
 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
 
-PROTOBUF_VER = "3.6.1"
-SHA = "0a4c6d0678eb2f063df332cff1a41647ef692c067b5cfb19e51bca778e79d9e0"
+PROTOBUF_VER = "3.6.1.3"
+SHA = "9510dd2afc29e7245e9e884336f848c8a6600a14ae726adb6befdb4f786f0be2"
 
 def generate_protobuf():
     http_archive(
         name = "com_google_protobuf",
-        urls = ["https://github.com/google/protobuf/releases/download/v%s/protobuf-all-%s.zip" %
-                (PROTOBUF_VER, PROTOBUF_VER)],
+        urls = ["https://github.com/protocolbuffers/protobuf/archive/v%s.zip" %
+                PROTOBUF_VER],
         sha256 = SHA,
         strip_prefix = "protobuf-" + PROTOBUF_VER,
     )
diff --git a/tools/package/features/BUILD b/tools/package/features/BUILD
index 7d31d25..451d707 100644
--- a/tools/package/features/BUILD
+++ b/tools/package/features/BUILD
@@ -23,6 +23,10 @@
         "@io_netty_netty_transport//jar",
         "@io_netty_netty_handler//jar",
         "@io_netty_netty_codec//jar",
+        "@io_netty_netty_codec_http//jar",
+        "@io_netty_netty_codec_http2//jar",
+        "@io_netty_netty_codec_socks//jar",
+        "@io_netty_netty_handler_proxy//jar",
         "@io_netty_netty_transport_native_epoll//jar",
         "@io_netty_netty_transport_native_unix_common//jar",
         "@io_netty_netty_resolver//jar",