Updates as much as possible except rules_jvm_external.
The latest rules_jvm_external v6.1 breaks this project, both under the previous Bazel version (7.0.2) and the new one (7.2.1). I've filed bazelbuild/rules_jvm_external#1189, which uses this repo and this PR as an example.
Adding protobuf explicitly resolves these warnings:
DEBUG: .../external/rules_jvm_external~/private/extensions/maven.bzl:154:14:
The maven repository 'maven' is used in two different bazel modules,
originally in 'com_engflow_bazel_invocation_analyzer'
and now in 'protobuf'
DEBUG: .../external/rules_jvm_external~/private/extensions/maven.bzl:154:14:
The maven repository 'maven' is used in two different bazel modules,
originally in 'com_engflow_bazel_invocation_analyzer'
and now in 'protobuf'
DEBUG: .../external/rules_jvm_external~/coursier.bzl:593:18:
Found duplicate artifact versions
com.google.code.gson:gson has multiple versions 2.11.0, 2.8.9
com.google.guava:guava has multiple versions 33.2.1-jre, 31.1-jre
com.google.truth:truth has multiple versions 1.4.3, 1.1.2
org.mockito:mockito-core has multiple versions 5.12.0, 4.3.1
Please remove duplicate artifacts from the artifact list so you do not
get unexpected artifact versions
rules_jvm_external v6.1 somehow creates duplicate jvm_import rules for binary and source jars, instead of using the srcjar attribute:
ERROR: Traceback (most recent call last):
File ".../external/rules_jvm_external~~maven~maven/BUILD",
line 34, column 11, in <toplevel>
jvm_import(
Error in jvm_import: jvm_import rule
'com_google_auto_value_auto_value_annotations' in package ''
conflicts with existing jvm_import rule, defined at
.../external/rules_jvm_external~~maven~maven/BUILD:9:11
The content of rules_jvm_external~~maven~maven/BUILD at lines 9 and 34:
jvm_import(
name = "com_google_auto_value_auto_value_annotations",
jars = ["com/google/auto/value/auto-value-annotations/1.10.1/auto-value-annotations-1.10.1.jar"],
jvm_import(
name = "com_google_auto_value_auto_value_annotations",
jars = ["com/google/auto/value/auto-value-annotations/1.10.1/auto-value-annotations-1.10.1-sources.jar"],
This pattern repeats for all the JAR targets.
The BUILD contents from v5.3, which builds successfully both before and after applying the PR changes:
jvm_import(
name = "com_google_auto_value_auto_value_annotations",
jars = ["com/google/auto/value/auto-value-annotations/1.10.1/auto-value-annotations-1.10.1.jar"],
srcjar = "com/google/auto/value/auto-value-annotations/1.10.1/auto-value-annotations-1.10.1-sources.jar",
Updates as much as possible except rules_jvm_external.
The latest rules_jvm_external v6.1 breaks this project, both under the previous Bazel version (7.0.2) and the new one (7.2.1). I've filed bazelbuild/rules_jvm_external#1189, which uses this repo and this PR as an example.
See the last section below for details.
Bazel update:
Bazel module updates:
JAR updates:
Test JAR updates:
Added explicit module spec and repinned the maven deps for:
Adding protobuf explicitly resolves these warnings:
See also:
Duplicate maven repositories when importing bazel_deps that use maven.install https://github.com/bazelbuild/rules_jvm_external/issues/916
Using maven as the repo name causes duplicate warnings when using bzlmod https://github.com/protocolbuffers/protobuf/issues/16839
MODULE.bazel doesn't define @maven repository https://github.com/protocolbuffers/protobuf/issues/17176
Stop including extra artifacts on maven.install() https://github.com/bazelbuild/rules_jvm_external/issues/1168
Use a custom name for the maven repository (maven_protobuf) https://github.com/protocolbuffers/protobuf/pull/17190
rules_jvm_external v6.1 somehow creates duplicate
jvm_import
rules for binary and source jars, instead of using thesrcjar
attribute:The content of rules_jvm_external~~maven~maven/BUILD at lines 9 and 34:
This pattern repeats for all the JAR targets.
The BUILD contents from v5.3, which builds successfully both before and after applying the PR changes: