Scope gRPC dependencies and rely on grpc-bom for single version#4784
Merged
Conversation
Replace the brittle `grpc-all` dependency (with its long exclusion list in
the parent pom) with the specific gRPC artifacts each module actually
uses. The `grpc-bom` import in dependencyManagement continues to enforce
a single version across all `io.grpc:*` artifacts.
Module changes:
- pom.xml: drop the `grpc-all` dependencyManagement block; the BOM alone
manages versions
- stream/common: `grpc-all` -> `grpc-api`, `grpc-stub`, `grpc-core`
(compile); `grpc-inprocess`, `grpc-util` (test)
- stream/tests-common: `grpc-all` -> `grpc-api`, `grpc-stub`; drop unused
`grpc-testing` (no `io.grpc.testing.*` imports anywhere)
- stream/proto: drop `grpc-protobuf` (dead after the LightProto
migration; generated code uses Netty `ByteBuf` only)
- stream/clients/java/base: add explicit `grpc-inprocess`,
`grpc-netty-shaded`, `grpc-util` that were silently inherited
- metadata-drivers/etcd: `grpc-all` -> `grpc-api`, `grpc-stub`
Drop pointless protobuf-java usages so statelib no longer needs it:
- statelib `Bytes.toLong(ByteString)` was a dead overload (every caller
uses the `byte[]` variant); removed
- statelib `MVCCStoreImpl` used `TextFormat.escapeBytes` once for an
error message; replaced with JDK 17 `HexFormat.of().formatHex`
- bookkeeper-server `BookieImplTest` had two no-op protobuf
round-trips (`ByteString.copyFrom(bytes).toByteArray()` and
`unsafeWrap(...).asReadOnlyByteBuffer()`); replaced with plain
`byte[]` and `ByteBuffer.wrap`
Update LICENSE-{all,server,bkctl}.bin.txt to match the new bundled jar
set: drop entries for grpc-all/-alts/-auth/-grpclb/-opentelemetry
/-protobuf/-protobuf-lite/-services/-testing/-xds/-rls
/-gcp-csm-observability and the transitively-removed proto-google-common
-protos, protobuf-java-util, api-common, google-http-client*,
google-auth-library-*, auto-value-annotations, re2j, opencensus-*,
conscrypt; clean up the orphaned source-URL footnotes.
Net dist change: 7 grpc jars (down from 18) and 1 protobuf jar
(down from 3, now sourced only via prometheus-metrics-exposition-formats).
CI's `dev/check-all-licenses` flagged remaining stale references that
were not caught in the previous commit:
- NOTICE-{all,server,bkctl}.bin.txt: drop the unbundled `grpc-all`,
`grpc-auth`, `grpc-protobuf`, `grpc-protobuf-lite`, `grpc-testing`
entries; add the previously-missing `grpc-api`, `grpc-inprocess`,
`grpc-util` to the gRPC list (these have always been bundled).
- LICENSE-{all,server,bkctl}.bin.txt: drop
`opentelemetry-gcp-resources-1.56.0-alpha.jar` (was transitive via the
removed `grpc-gcp-csm-observability`, no longer bundled).
- LICENSE-bkctl.bin.txt: drop the entire OpenTelemetry SDK list and the
protobuf-java entry; bkctl never bundled any of these (pre-existing
staleness, hidden in CI by `set -e` stopping on the first dist error).
- bookkeeper-dist/src/assemble/{bin-all,bin-server,bkctl}.xml: drop the
`deps/google-auth-library-credentials-0.20.0/LICENSE` include from
every assembly (orphaned now that the jar is no longer bundled), and
drop the `deps/protobuf/LICENSE` include from the bkctl assembly
(bkctl doesn't ship protobuf-java).
- Delete the orphaned
`bookkeeper-dist/src/main/resources/deps/google-auth-library-credentials-0.20.0/`
directory.
Verified locally: `dev/check-all-licenses` passes against freshly-built
all/server/bkctl tarballs.
lhotari
approved these changes
May 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
grpc-all(with its long exclusion list in the parent pom) and depend on the specificio.grpc:*artifacts each module actually uses;grpc-bomcontinues to enforce a single version across them.grpc-protobuffromstream-storage-proto— dead after the LightProto migration; the generated code uses NettyByteBufonly and no Java code anywhere importsio.grpc.protobuf.*.protobuf-javausages sostatelibno longer needs the dependency:statelib/Bytes.toLong(ByteString)was a dead overload — every caller uses thebyte[]variant.statelib/MVCCStoreImplusedTextFormat.escapeBytesonce for an error message — replaced with JDK 17HexFormat.of().formatHex.bookkeeper-server/BookieImplTesthad two no-op protobuf round-trips (ByteString.copyFrom(bytes).toByteArray()andunsafeWrap(...).asReadOnlyByteBuffer()) — replaced with plainbyte[]/ByteBuffer.wrap.LICENSE-{all,server,bkctl}.bin.txtto match the new bundled jar set: drop entries forgrpc-all,grpc-alts,grpc-auth,grpc-grpclb,grpc-opentelemetry,grpc-protobuf,grpc-protobuf-lite,grpc-services,grpc-testing,grpc-xds,grpc-rls,grpc-gcp-csm-observability, plus transitively-removedproto-google-common-protos,protobuf-java-util,api-common,google-http-client*,google-auth-library-*,auto-value-annotations,re2j,opencensus-*,conscrypt; clean up orphaned source-URL footnotes.Module-by-module pom changes
pom.xmlgrpc-bomimport +grpc-alldependencyManagement entry with 8 exclusionsgrpc-bomimport onlystream/commongrpc-all,grpc-netty-shadedgrpc-api,grpc-stub,grpc-core,grpc-netty-shaded;grpc-inprocess,grpc-util(test)stream/tests-commongrpc-all,grpc-netty-shaded,grpc-testinggrpc-api,grpc-stub,grpc-netty-shadedstream/protogrpc-protobufstream/clients/java/basegrpc-all)grpc-inprocess,grpc-netty-shaded;grpc-util(test)metadata-drivers/etcdgrpc-all,grpc-netty-shadedgrpc-api,grpc-stub,grpc-netty-shadedNet effect on the BK distribution
bookkeeper-dist/{all,server,bkctl}now ships 7io.grpc:*jars (grpc-api,grpc-stub,grpc-core,grpc-context,grpc-inprocess,grpc-netty-shaded,grpc-util) — down from 18.protobuf-javajar — down from 3 (protobuf-java,protobuf-java-util,proto-google-common-protos). The remainingprotobuf-javais now sourced only viaprometheus-metrics-exposition-formats-no-protobuf, not via gRPC.metadata-drivers/etcd(which legitimately needsgrpc-protobuf/protobuf-javafor jetcd) is not pulled into the BK distribution orbookkeeper-server, so its protobuf-java usage doesn't affect dist licensing.Test plan
mvn -pl stream/common,stream/clients/java/base,stream/statelib -DstreamTests test— 229 tests pass (stream/common 41, clients/java/base 70, statelib 118).mvn -pl bookkeeper-server test -Dtest=BookieImplTest— 3 tests pass (covers the protobuf-removal refactor).mvn -DskipTests -pl '!native-io,!bookkeeper-dist/{all,server,bkctl}' --fae install— full reactor builds and installs.mvn -pl bookkeeper-dist/all dependency:tree— verified noio.grpc:grpc-all/grpc-protobuf/proto-google-common-protos/protobuf-java-util/google-auth-library-*/opencensus-*/conscryptin the dist tree.