From e99ceb53daffcb1d36ed01fba7d4cb56274c5721 Mon Sep 17 00:00:00 2001 From: Tanner Stirrat Date: Tue, 23 Sep 2025 14:05:03 -0600 Subject: [PATCH] Exclude well-known types from dependencies --- build.gradle | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d3887135..d1706bb6 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ plugins { repositories { // The Google mirror is less flaky than mavenCentral() - maven { url "https://maven-central.storage-download.googleapis.com/maven2/" } + maven { url = "https://maven-central.storage-download.googleapis.com/maven2/" } mavenCentral() mavenLocal() } @@ -100,7 +100,13 @@ sourceSets { main { dependencies { implementation("io.grpc:grpc-protobuf:${grpcVersion}") { + // We want the same version of protobuf-java as was used in the compilation step, + // so we overwrite this dependency. exclude group: 'com.google.protobuf', module: 'protobuf-java' + // These classes are included by the buf generation step, so we + // don't need the external dependency that brings them in. This also ensures + // that the definitions line up with what's expected. + exclude group: 'com.google.api.grpc', module: 'proto-google-common-protos' } api "com.google.protobuf:protobuf-java:${protocVersion}" implementation "io.grpc:grpc-stub:${grpcVersion}"