Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename maven to protobuf_maven in MODULE.bazel #18641

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ use_repo(
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")

maven.install(
name = "protobuf_maven",
artifacts = [
"com.google.caliper:caliper:1.0-beta-3",
"com.google.code.findbugs:jsr305:3.0.2",
Expand All @@ -178,7 +179,7 @@ maven.install(
],
)

use_repo(maven, "maven")
use_repo(maven, "protobuf_maven")

# Development dependencies
bazel_dep(
Expand Down
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ maven_install(
],
)

load("@maven//:defs.bzl", "pinned_maven_install")
load("@protobuf_maven//:defs.bzl", "pinned_maven_install")
Copy link
Contributor

@JasonLunn JasonLunn Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change correct? In the error logs for the failing tests we see:

ERROR: Failed to load Starlark extension '@@protobuf_maven//:defs.bzl'.
Cycle in the workspace file detected. This indicates that a repository is used prior to being defined.
The following chain of repository dependencies lead to the missing definition.
- @@protobuf_maven
This could either mean you have to add the '@@protobuf_maven' repository with a statement like `http_archive` in your WORKSPACE file (note that transitive dependencies are not added automatically), or move an existing definition earlier in your WORKSPACE file.
ERROR: Error computing the main repository mapping: cycles detected during computation of main repo mapping

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the problem was I forgot to add the name = "protobuf_maven" in the WORKSPACE. I only did it in MODULE.bazel for the first commit.


pinned_maven_install()

Expand Down
52 changes: 26 additions & 26 deletions java/core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ protobuf_java_library(
":generic_test_protos_java_proto",
":java_test_protos_java_proto",
":lite_test_protos_java_proto",
"@maven//:com_google_guava_guava",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_guava_guava",
"@protobuf_maven//:junit_junit",
],
)

Expand Down Expand Up @@ -441,10 +441,10 @@ junit_tests(
":java_test_protos_java_proto",
":lite_test_protos_java_proto",
":test_util",
"@maven//:com_google_guava_guava",
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@maven//:org_mockito_mockito_core",
"@protobuf_maven//:com_google_guava_guava",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
"@protobuf_maven//:org_mockito_mockito_core",
],
)

Expand All @@ -460,9 +460,9 @@ junit_tests(
],
deps = [
":core",
"@maven//:com_google_guava_guava",
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_guava_guava",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
],
)

Expand Down Expand Up @@ -517,8 +517,8 @@ protobuf_java_library(
":java_test_protos_java_proto_lite",
":lite_runtime_only",
":lite_test_protos_java_proto_lite",
"@maven//:com_google_guava_guava",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_guava_guava",
"@protobuf_maven//:junit_junit",
],
)

Expand Down Expand Up @@ -585,9 +585,9 @@ junit_tests(
":lite",
":lite_test_protos_java_proto_lite",
":test_util_lite",
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@maven//:org_mockito_mockito_core",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
"@protobuf_maven//:org_mockito_mockito_core",
],
)

Expand All @@ -601,8 +601,8 @@ protobuf_java_library(
deps = [
":core",
"//compatibility:v25_test_protos_srcjar",
"@maven//:com_google_guava_guava",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_guava_guava",
"@protobuf_maven//:junit_junit",
],
)

Expand Down Expand Up @@ -633,10 +633,10 @@ junit_tests(
":core",
":v25_test_util_srcjar",
"//compatibility:v25_test_protos_srcjar",
"@maven//:com_google_guava_guava",
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@maven//:org_mockito_mockito_core",
"@protobuf_maven//:com_google_guava_guava",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
"@protobuf_maven//:org_mockito_mockito_core",
],
)

Expand All @@ -650,8 +650,8 @@ protobuf_java_library(
deps = [
":core",
"//compatibility:v25_test_protos_jar",
"@maven//:com_google_guava_guava",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_guava_guava",
"@protobuf_maven//:junit_junit",
],
)

Expand Down Expand Up @@ -682,10 +682,10 @@ junit_tests(
":core",
":v25_test_util_jar",
"//compatibility:v25_test_protos_jar",
"@maven//:com_google_guava_guava",
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@maven//:org_mockito_mockito_core",
"@protobuf_maven//:com_google_guava_guava",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
"@protobuf_maven//:org_mockito_mockito_core",
],
)

Expand Down
4 changes: 2 additions & 2 deletions java/internal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ java_test(
srcs = ["JavaVersionTest.java"],
test_class = "JavaVersionTest",
deps = [
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
],
)
12 changes: 6 additions & 6 deletions java/kotlin-lite/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ kt_jvm_library(
"//java/kotlin:only_for_use_in_proto_generated_code_its_generator_and_tests",
"//java/kotlin:shared_runtime",
"//java/lite",
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
"@rules_kotlin//kotlin/compiler:kotlin-test",
],
)
Expand Down Expand Up @@ -195,8 +195,8 @@ kt_jvm_library(
deps = [
":kotlin_unittest_lite",
"//java/core:test_util_lite",
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
],
)

Expand All @@ -212,8 +212,8 @@ kt_jvm_library(
deps = [
":kotlin_proto3_unittest_lite",
"//java/core:test_util_lite",
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
],
)

Expand Down
22 changes: 11 additions & 11 deletions java/kotlin/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ kt_jvm_library(
deps = [
":bytestring_lib",
"//java/lite",
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
"@rules_kotlin//kotlin/compiler:kotlin-test",
],
)
Expand Down Expand Up @@ -136,9 +136,9 @@ kt_jvm_library(
":example_extensible_message_java_proto",
":only_for_use_in_proto_generated_code_its_generator_and_tests",
":shared_runtime",
"@maven//:com_google_guava_guava_testlib",
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_guava_guava_testlib",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
"@rules_kotlin//kotlin/compiler:kotlin-test",
],
)
Expand All @@ -162,8 +162,8 @@ kt_jvm_library(
":only_for_use_in_proto_generated_code_its_generator_and_tests",
":shared_runtime",
"//java/core",
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
"@rules_kotlin//kotlin/compiler:kotlin-test",
],
)
Expand Down Expand Up @@ -274,8 +274,8 @@ kt_jvm_library(
deps = [
":kotlin_unittest",
"//java/core:test_util",
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
"@rules_kotlin//kotlin/compiler:kotlin-reflect",
],
)
Expand All @@ -292,8 +292,8 @@ kt_jvm_library(
deps = [
":kotlin_proto3_unittest",
"//java/core:test_util",
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
],
)

Expand Down
4 changes: 2 additions & 2 deletions java/lite/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ junit_tests(
"//java/core:java_test_protos_java_proto_lite",
"//java/core:lite_test_protos_java_proto_lite",
"//java/core:test_util_lite",
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
],
)

Expand Down
6 changes: 3 additions & 3 deletions java/osgi/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ java_binary(
srcs = ["OsgiWrapper.java"],
main_class = "com.google.protobuf.osgi.OsgiWrapper",
deps = [
"@maven//:biz_aQute_bnd_biz_aQute_bndlib",
"@maven//:com_google_guava_guava",
"@maven//:info_picocli_picocli",
"@protobuf_maven//:biz_aQute_bnd_biz_aQute_bndlib",
"@protobuf_maven//:com_google_guava_guava",
"@protobuf_maven//:info_picocli_picocli",
],
)
28 changes: 14 additions & 14 deletions java/util/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ java_library(
visibility = ["//visibility:public"],
deps = [
"//java/core",
"@maven//:com_google_code_findbugs_jsr305",
"@maven//:com_google_code_gson_gson",
"@maven//:com_google_errorprone_error_prone_annotations",
"@maven//:com_google_guava_guava",
"@maven//:com_google_j2objc_j2objc_annotations",
"@protobuf_maven//:com_google_code_findbugs_jsr305",
"@protobuf_maven//:com_google_code_gson_gson",
"@protobuf_maven//:com_google_errorprone_error_prone_annotations",
"@protobuf_maven//:com_google_guava_guava",
"@protobuf_maven//:com_google_j2objc_j2objc_annotations",
],
)

Expand All @@ -33,11 +33,11 @@ protobuf_versioned_java_library(
visibility = ["//visibility:public"],
deps = [
"//java/core",
"@maven//:com_google_code_findbugs_jsr305",
"@maven//:com_google_code_gson_gson",
"@maven//:com_google_errorprone_error_prone_annotations",
"@maven//:com_google_guava_guava",
"@maven//:com_google_j2objc_j2objc_annotations",
"@protobuf_maven//:com_google_code_findbugs_jsr305",
"@protobuf_maven//:com_google_code_gson_gson",
"@protobuf_maven//:com_google_errorprone_error_prone_annotations",
"@protobuf_maven//:com_google_guava_guava",
"@protobuf_maven//:com_google_j2objc_j2objc_annotations",
],
)

Expand Down Expand Up @@ -90,10 +90,10 @@ junit_tests(
":util",
"//java/core",
"//java/core:generic_test_protos_java_proto",
"@maven//:com_google_code_gson_gson",
"@maven//:com_google_guava_guava",
"@maven//:com_google_truth_truth",
"@maven//:junit_junit",
"@protobuf_maven//:com_google_code_gson_gson",
"@protobuf_maven//:com_google_guava_guava",
"@protobuf_maven//:com_google_truth_truth",
"@protobuf_maven//:junit_junit",
],
)

Expand Down
Loading