Skip to content

Commit

Permalink
fix: Do not use default maven repo
Browse files Browse the repository at this point in the history
  • Loading branch information
honnix committed Oct 14, 2024
1 parent ca43d78 commit 81a7a8e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
5 changes: 4 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,18 @@ use_repo(

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")

MAVEN_REPO = "grpc_java_maven"

maven.install(
name = MAVEN_REPO,
artifacts = IO_GRPC_GRPC_JAVA_ARTIFACTS,
repositories = [
"https://repo.maven.apache.org/maven2/",
],
strict_visibility = True,
)

use_repo(maven, "maven")
use_repo(maven, maven = MAVEN_REPO)

maven.override(
coordinates = "com.google.protobuf:protobuf-java",
Expand Down
2 changes: 2 additions & 0 deletions compiler/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cc_binary(

java_library(
name = "java_grpc_library_deps__do_not_reference",
neverlink = True,
exports = [
"//api",
"//protobuf",
Expand All @@ -31,6 +32,7 @@ java_library(

java_library(
name = "java_lite_grpc_library_deps__do_not_reference",
neverlink = True,
exports = [
"//api",
"//protobuf-lite",
Expand Down
47 changes: 45 additions & 2 deletions examples/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,56 @@ switched_rules.use_languages(java = True)

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")

use_repo(maven, "maven")
MAVEN_REPO = "grpc_java_examples_maven"

use_repo(maven, maven = MAVEN_REPO)


IO_GRPC_GRPC_JAVA_ARTIFACTS = [
"com.google.android:annotations:4.1.1.4",
"com.google.api.grpc:proto-google-common-protos:2.29.0",
"com.google.auth:google-auth-library-credentials:1.23.0",
"com.google.auth:google-auth-library-oauth2-http:1.23.0",
"com.google.auto.value:auto-value-annotations:1.11.0",
"com.google.auto.value:auto-value:1.11.0",
"com.google.code.findbugs:jsr305:3.0.2",
"com.google.code.gson:gson:2.11.0",
"com.google.errorprone:error_prone_annotations:2.28.0",
"com.google.guava:failureaccess:1.0.1",
"com.google.guava:guava:33.2.1-android",
"com.google.re2j:re2j:1.7",
"com.google.truth:truth:1.4.2",
"com.squareup.okhttp:okhttp:2.7.5",
"com.squareup.okio:okio:2.10.0", # 3.0+ needs swapping to -jvm; need work to avoid flag-day
"io.netty:netty-buffer:4.1.110.Final",
"io.netty:netty-codec-http2:4.1.110.Final",
"io.netty:netty-codec-http:4.1.110.Final",
"io.netty:netty-codec-socks:4.1.110.Final",
"io.netty:netty-codec:4.1.110.Final",
"io.netty:netty-common:4.1.110.Final",
"io.netty:netty-handler-proxy:4.1.110.Final",
"io.netty:netty-handler:4.1.110.Final",
"io.netty:netty-resolver:4.1.110.Final",
"io.netty:netty-tcnative-boringssl-static:2.0.65.Final",
"io.netty:netty-tcnative-classes:2.0.65.Final",
"io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.110.Final",
"io.netty:netty-transport-native-unix-common:4.1.110.Final",
"io.netty:netty-transport:4.1.110.Final",
"io.opencensus:opencensus-api:0.31.0",
"io.opencensus:opencensus-contrib-grpc-metrics:0.31.0",
"io.perfmark:perfmark-api:0.27.0",
"junit:junit:4.13.2",
"org.apache.tomcat:annotations-api:6.0.53",
"org.checkerframework:checker-qual:3.12.0",
"org.codehaus.mojo:animal-sniffer-annotations:1.24",
]

maven.install(
name = MAVEN_REPO,
artifacts = [
"com.google.api.grpc:grpc-google-cloud-pubsub-v1:0.1.24",
"com.google.api.grpc:proto-google-cloud-pubsub-v1:0.1.24",
],
] + IO_GRPC_GRPC_JAVA_ARTIFACTS,
repositories = ["https://repo.maven.apache.org/maven2/"],
strict_visibility = True,
)

0 comments on commit 81a7a8e

Please sign in to comment.