Skip to content

Commit 8355551

Browse files
committed
Move grpc-java to MODULE.bazel, bump to 1.62.2
grpc-java only got MODULE.bazel support as of this most recent version: - grpc/grpc-java#11046 - bazelbuild/bazel-central-registry#1699 This grpc-java version bump exposed two issues that are fixed in this commit: 1. The //java/com/engflow/notificationqueue:client target dependency on @maven//:io_netty_netty_handler broke. The original WORKSPACE import of io_grpc_grpc_java imported this dependency directly by passing IO_GRPC_GRPC_JAVA_ARTIFACTS directly to `maven_install`. The `maven.install` call from grpc/grpc-java's MODULE.bazel sets `strict_visibility = True`. Somehow the other dependencies registered by grpc-java's MODULE.bazel are accessible to notificationqueue:client, but netty-handler isn't. The solution was to add the `io.netty:netty-handler:4.1.100.Final` artifact to the `maven.install` call in this project's MODULE.bazel. It doesn't seem an optimal solution, but it works for now. 2. grpc/grpc-java removed `io.grpc.stub.MetadataUtils.attachHeaders()` in grpc/grpc-java#10443. This caused notificationqueue:client to fail to compile, but that PR revealed the replacement for the deprecated `attachHeaders` call. This commit applies that replacement.
1 parent d41dc3d commit 8355551

File tree

4 files changed

+6780
-3102
lines changed

4 files changed

+6780
-3102
lines changed

MODULE.bazel

+19
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,29 @@ bazel_dep(name = "rules_java", version = "7.5.0")
6767

6868
# https://github.com/bazelbuild/rules_jvm_external/blob/master/docs/bzlmod.md
6969
bazel_dep(name = "rules_jvm_external", version = "6.0")
70+
bazel_dep(
71+
name = "grpc-java",
72+
version = "1.62.2",
73+
repo_name = "io_grpc_grpc_java",
74+
)
7075

7176
# Loads rules required to compile proto files
7277
bazel_dep(name = "rules_proto_grpc", version = "5.0.0-alpha2")
7378

79+
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
80+
maven.install(
81+
artifacts = [
82+
"commons-cli:commons-cli:1.5.0",
83+
"com.google.oauth-client:google-oauth-client:1.34.1",
84+
"io.netty:netty-handler:4.1.100.Final",
85+
],
86+
strict_visibility = True,
87+
repositories = [
88+
"https://repo.maven.apache.org/maven2/",
89+
],
90+
)
91+
use_repo(maven, "maven")
92+
7493
bazel_dep(
7594
name = "rules_swift",
7695
version = "1.18.0",

0 commit comments

Comments
 (0)