From 992aeb206ab9d82d86066c8abf8a4445822b0db9 Mon Sep 17 00:00:00 2001
From: Ivo List <ilist@google.com>
Date: Fri, 30 Dec 2022 07:49:53 +0100
Subject: [PATCH] fix

---
 BUILD.bazel                  |  4 +--
 java/core/BUILD.bazel        | 54 ++++++++++--------------------------
 java/kotlin-lite/BUILD.bazel | 12 ++++----
 java/kotlin/BUILD.bazel      | 22 +++++++--------
 java/lite/BUILD.bazel        |  4 +--
 java/util/BUILD.bazel        | 30 ++++++--------------
 6 files changed, 44 insertions(+), 82 deletions(-)

diff --git a/BUILD.bazel b/BUILD.bazel
index 0f6e41e..88226cc 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -138,7 +138,7 @@ cc_library(
     visibility = ["//visibility:public"],
     deps = [":protobuf_lite"] + select({
         "//build_defs:config_msvc": [],
-        "//conditions:default": ["@zlib//:zlib"],
+        "//conditions:default": ["@io_bazel//third_party/zlib"],
     }),
 )
 
@@ -755,7 +755,7 @@ cc_test(
         "@com_google_googletest//:gtest_main",
     ] + select({
         "//build_defs:config_msvc": [],
-        "//conditions:default": ["@zlib//:zlib"],
+        "//conditions:default": ["@io_bazel//third_party/zlib"],
     }),
 )
 
diff --git a/java/core/BUILD.bazel b/java/core/BUILD.bazel
index cfd53f4..d312923 100644
--- a/java/core/BUILD.bazel
+++ b/java/core/BUILD.bazel
@@ -1,6 +1,5 @@
 load("@bazel_skylib//rules:build_test.bzl", "build_test")
 load("@rules_java//java:defs.bzl", "java_library", "java_lite_proto_library", "java_proto_library")
-load("@rules_jvm_external//:defs.bzl", "java_export")
 load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
 load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library")
 load("//conformance:defs.bzl", "conformance_test")
@@ -131,18 +130,6 @@ java_library(
     ],
 )
 
-# Bazel users, don't depend on this target, use //java/lite.
-java_export(
-    name = "lite_mvn",
-    maven_coordinates = "com.google.protobuf:protobuf-javalite:%s" % PROTOBUF_JAVA_VERSION,
-    pom_template = "//java/lite:pom_template.xml",
-    resources = [
-        "//:lite_well_known_protos",
-    ],
-    tags = ["manual"],
-    runtime_deps = [":lite"],
-)
-
 java_library(
     name = "lite_runtime_only",
     srcs = LITE_SRCS,
@@ -185,19 +172,6 @@ java_library(
     ],
 )
 
-# Bazel users, don't depend on this target, use :core.
-java_export(
-    name = "core_mvn",
-    maven_coordinates = "com.google.protobuf:protobuf-java:%s" % PROTOBUF_JAVA_VERSION,
-    pom_template = "pom_template.xml",
-    resources = [
-        "//:built_in_runtime_protos",
-        "//:well_known_type_protos",
-    ],
-    tags = ["manual"],
-    runtime_deps = [":core"],
-)
-
 filegroup(
     name = "release",
     srcs = [
@@ -271,8 +245,8 @@ java_library(
         ":core",
         ":generic_test_protos_java_proto",
         ":java_test_protos_java_proto",
-        "@maven//:com_google_guava_guava",
-        "@maven//:junit_junit",
+        "@io_bazel//third_party:guava",
+        "@io_bazel//third_party:junit4",
     ],
 )
 
@@ -318,10 +292,10 @@ junit_tests(
         ":generic_test_protos_java_proto",
         ":java_test_protos_java_proto",
         ":test_util",
-        "@maven//:com_google_guava_guava",
-        "@maven//:com_google_truth_truth",
-        "@maven//:junit_junit",
-        "@maven//:org_mockito_mockito_core",
+        "@io_bazel//third_party:guava",
+        "@io_bazel//third_party:truth",
+        "@io_bazel//third_party:junit4",
+        "@io_bazel//third_party:mockito",
     ],
 )
 
@@ -337,9 +311,9 @@ junit_tests(
     ],
     deps = [
         ":core",
-        "@maven//:com_google_guava_guava",
-        "@maven//:com_google_truth_truth",
-        "@maven//:junit_junit",
+        "@io_bazel//third_party:guava",
+        "@io_bazel//third_party:truth",
+        "@io_bazel//third_party:junit4",
     ],
 )
 
@@ -384,8 +358,8 @@ java_library(
         ":generic_test_protos_java_proto_lite",
         ":java_test_protos_java_proto_lite",
         ":lite_runtime_only",
-        "@maven//:com_google_guava_guava",
-        "@maven//:junit_junit",
+        "@io_bazel//third_party:guava",
+        "@io_bazel//third_party:junit4",
     ],
 )
 
@@ -447,9 +421,9 @@ junit_tests(
         ":java_test_protos_java_proto_lite",
         ":lite",
         ":test_util_lite",
-        "@maven//:com_google_truth_truth",
-        "@maven//:junit_junit",
-        "@maven//:org_mockito_mockito_core",
+        "@io_bazel//third_party:truth",
+        "@io_bazel//third_party:junit4",
+        "@io_bazel//third_party:mockito",
     ],
 )
 
diff --git a/java/kotlin-lite/BUILD.bazel b/java/kotlin-lite/BUILD.bazel
index d3d9ddf..3516d63 100644
--- a/java/kotlin-lite/BUILD.bazel
+++ b/java/kotlin-lite/BUILD.bazel
@@ -94,8 +94,8 @@ kt_jvm_library(
         "//java/kotlin:shared_runtime",
         "//java/lite",
         "@com_github_jetbrains_kotlin//:kotlin-test",
-        "@maven//:com_google_truth_truth",
-        "@maven//:junit_junit",
+        "@io_bazel//third_party:truth",
+        "@io_bazel//third_party:junit4",
     ],
 )
 
@@ -187,8 +187,8 @@ kt_jvm_library(
     deps = [
         ":kotlin_unittest_lite",
         "//java/core:test_util_lite",
-        "@maven//:com_google_truth_truth",
-        "@maven//:junit_junit",
+        "@io_bazel//third_party:truth",
+        "@io_bazel//third_party:junit4",
     ],
 )
 
@@ -204,8 +204,8 @@ kt_jvm_library(
     deps = [
         ":kotlin_proto3_unittest_lite",
         "//java/core:test_util_lite",
-        "@maven//:com_google_truth_truth",
-        "@maven//:junit_junit",
+        "@io_bazel//third_party:truth",
+        "@io_bazel//third_party:junit4",
     ],
 )
 
diff --git a/java/kotlin/BUILD.bazel b/java/kotlin/BUILD.bazel
index 67fc6e0..1ed26aa 100644
--- a/java/kotlin/BUILD.bazel
+++ b/java/kotlin/BUILD.bazel
@@ -101,8 +101,8 @@ kt_jvm_library(
         ":bytestring_lib",
         "//java/lite",
         "@com_github_jetbrains_kotlin//:kotlin-test",
-        "@maven//:com_google_truth_truth",
-        "@maven//:junit_junit",
+        "@io_bazel//third_party:truth",
+        "@io_bazel//third_party:junit4",
     ],
 )
 
@@ -136,9 +136,9 @@ kt_jvm_library(
         ":only_for_use_in_proto_generated_code_its_generator_and_tests",
         ":shared_runtime",
         "@com_github_jetbrains_kotlin//:kotlin-test",
-        "@maven//:com_google_guava_guava_testlib",
-        "@maven//:com_google_truth_truth",
-        "@maven//:junit_junit",
+        "@io_bazel//third_party:guava",
+        "@io_bazel//third_party:truth",
+        "@io_bazel//third_party:junit4",
     ],
 )
 
@@ -162,8 +162,8 @@ kt_jvm_library(
         ":shared_runtime",
         "//java/core",
         "@com_github_jetbrains_kotlin//:kotlin-test",
-        "@maven//:com_google_truth_truth",
-        "@maven//:junit_junit",
+        "@io_bazel//third_party:truth",
+        "@io_bazel//third_party:junit4",
     ],
 )
 
@@ -271,8 +271,8 @@ kt_jvm_library(
     deps = [
         ":kotlin_unittest",
         "//java/core:test_util",
-        "@maven//:com_google_truth_truth",
-        "@maven//:junit_junit",
+        "@io_bazel//third_party:truth",
+        "@io_bazel//third_party:junit4",
     ],
 )
 
@@ -288,8 +288,8 @@ kt_jvm_library(
     deps = [
         ":kotlin_proto3_unittest",
         "//java/core:test_util",
-        "@maven//:com_google_truth_truth",
-        "@maven//:junit_junit",
+        "@io_bazel//third_party:truth",
+        "@io_bazel//third_party:junit4",
     ],
 )
 
diff --git a/java/lite/BUILD.bazel b/java/lite/BUILD.bazel
index 9ae3c51..f1ce750 100644
--- a/java/lite/BUILD.bazel
+++ b/java/lite/BUILD.bazel
@@ -73,8 +73,8 @@ junit_tests(
         "//java/core:generic_test_protos_java_proto_lite",
         "//java/core:java_test_protos_java_proto_lite",
         "//java/core:test_util_lite",
-        "@maven//:com_google_truth_truth",
-        "@maven//:junit_junit",
+        "@io_bazel//third_party:truth",
+        "@io_bazel//third_party:junit4",
     ],
 )
 
diff --git a/java/util/BUILD.bazel b/java/util/BUILD.bazel
index e3804fb..cecd254 100644
--- a/java/util/BUILD.bazel
+++ b/java/util/BUILD.bazel
@@ -1,5 +1,4 @@
 load("@rules_java//java:defs.bzl", "java_proto_library")
-load("@rules_jvm_external//:defs.bzl", "java_export")
 load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix")
 load("@rules_proto//proto:defs.bzl", "proto_library")
 load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION")
@@ -13,25 +12,14 @@ 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",
+        "@io_bazel//third_party:jsr305",
+        "@io_bazel//third_party:gson",
+        "@io_bazel//third_party:error_prone_annotations",
+        "@io_bazel//third_party:guava",
+        "@io_bazel//third_party/java/j2objc-annotations",
     ],
 )
 
-# Bazel users, don't depend on this target, use :util.
-java_export(
-    name = "util_mvn",
-    deploy_env = ["//java/core"],
-    maven_coordinates = "com.google.protobuf:protobuf-java-util:%s" % PROTOBUF_JAVA_VERSION,
-    pom_template = "pom_template.xml",
-    tags = ["manual"],
-    visibility = ["//java:__pkg__"],
-    runtime_deps = [":util"],
-)
-
 filegroup(
     name = "release",
     srcs = [
@@ -70,10 +58,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",
+        "@io_bazel//third_party:gson",
+        "@io_bazel//third_party:guava",
+        "@io_bazel//third_party:truth",
+        "@io_bazel//third_party:junit4",
     ],
 )
 
-- 
2.39.0.314.g84b9a713c41-goog

