Skip to content

Rename maven install back to in MODULE.bazel#22545

Merged
copybara-service[bot] merged 1 commit intomainfrom
test_781031722
Jul 11, 2025
Merged

Rename maven install back to in MODULE.bazel#22545
copybara-service[bot] merged 1 commit intomainfrom
test_781031722

Conversation

@copybara-service
Copy link
Copy Markdown

Rename maven install back to in MODULE.bazel

Fixes #21177

This PR essentially reverts #18641, which claimed

Since protobuf is not contributing to user's JARs

This is not true since targets like @com_google_protobuf//:protobuf_java are meant to be consumed by other projects, therefore protobuf should not use a private maven install namespace. Otherwise, it leads to duplicated maven jars and classpath conflicts. See #21177 and bazel-contrib/rules_jvm_external#916 (comment)

The original warning message caused by multiple modules contributing to maven can be suppressed with bazel-contrib/rules_jvm_external#1393, which will be available in rules_jvm_external 6.8.

The PR use a repo mapping trick of use_repo to keep BUILD files intact, underlying both protobuf_maven and protobuf_maven_dev points to the universal maven install, while targets in protobuf_maven_dev are only available while protobuf is the root module and won't propagate to dependents.

@copybara-service copybara-service Bot force-pushed the test_781031722 branch 2 times, most recently from a4c51d8 to f39369a Compare July 9, 2025 14:31
Fixes #21177

This PR essentially reverts #18641, which claimed

> Since protobuf is not contributing to user's JARs

This is not true since targets like `@com_google_protobuf//:protobuf_java` are meant to be consumed by other projects, therefore protobuf should not use a private maven install namespace. Otherwise, it leads to duplicated maven jars and classpath conflicts. See #21177 and bazel-contrib/rules_jvm_external#916 (comment)

The original warning message caused by multiple modules contributing to `maven` can be suppressed with bazel-contrib/rules_jvm_external#1393, which will be available in rules_jvm_external 6.8.

Closes #22544

PiperOrigin-RevId: 782032198
@copybara-service copybara-service Bot merged commit 1999135 into main Jul 11, 2025
@copybara-service copybara-service Bot deleted the test_781031722 branch July 11, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarification on protobuf_maven namespace change and transitive dependency resolution

1 participant