Closed
Description
Downstream bug in rules_jvm_external: bazel-contrib/rules_jvm_external#916
What version of protobuf and what language are you using?
v23.1
What did you expect to see
A clean build when using bzlmod.
What did you see instead?
DEBUG: $TMP/external/rules_jvm_external~/private/extensions/maven.bzl:154:14:
The maven repository 'maven' is used in two different bazel modules,
originally in '<my_workspace>' and now in 'protobuf'
Summarizing @shs96c in bazel-contrib/rules_jvm_external#916 (comment)
The common maven
repo name allows rulesets to contribute to the user's JARs. However, this implies that maven
is for the end user, not for transitive dependencies. If a ruleset needs private dependencies, it should use a custom namespace rather than the maven
namespace.
- rules_jvm_external uses rules_jvm_external_deps instead of
maven
. - rules_kotlin uses kotlin_rules_maven instead of
maven
.
Proposed fixes
There are a few ways to fix the logline:
- Patch protobuf in the Bazel Central Registry rewrite
maven
toprotobuf_maven
. - Modify the protobuf repo to rewrite
maven
toprotobuf_maven
. - Fetch the JARs manually without using Maven or rules_jvm_external. Trims the dependency graph a fair bit.
I think 2 is the best short-term option. If you're open to it, I can send a PR.
Activity