Rename maven to protobuf_maven in MODULE.bazel (#18641) (#19477)

The default name for the rules_jvm_external.maven rule is "maven". When not set, it defaults to "maven". For root modules also using rules_jvm_external, the name clash causes a warning:

```
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 [1]:

> 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.

Since protobuf is not contributing to user's JARs, we'll use a custom namespace. There's precedent for using a custom namespace for library modules:

- rules_jvm_external uses `rules_jvm_external_deps` instead of `maven`.
- rules_kotlin uses `kotlin_rules_maven` instead of `maven`.

[1]: https://github.com/bazel-contrib/rules_jvm_external/issues/916#issuecomment-1645527584

Fixes #16839.

Closes #18641

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/18641 from jschaf:joe/protobuf-maven bd2c62f3118264adc1e725102d1ecc576f145f35
PiperOrigin-RevId: 684625084

Co-authored-by: Joe Schafer <joe.schafer@delta46.us>
9 files changed
tree: 4bb9262767c6b00dc425f00eadb786349658ace8
  1. .bcr/
  2. .github/
  3. bazel/
  4. benchmarks/
  5. build_defs/
  6. ci/
  7. cmake/
  8. compatibility/
  9. conformance/
  10. csharp/
  11. docs/
  12. editions/
  13. editors/
  14. examples/
  15. go/
  16. hpb/
  17. hpb_generator/
  18. java/
  19. lua/
  20. objectivec/
  21. php/
  22. pkg/
  23. protos/
  24. python/
  25. ruby/
  26. rust/
  27. src/
  28. third_party/
  29. toolchain/
  30. upb/
  31. upb_generator/
  32. .bazelignore
  33. .bazelrc
  34. .clang-format
  35. .gitignore
  36. .gitmodules
  37. .readthedocs.yml
  38. appveyor.bat
  39. appveyor.yml
  40. BUILD.bazel
  41. Cargo.bazel.lock
  42. Cargo.lock
  43. CMakeLists.txt
  44. CODE_OF_CONDUCT.md
  45. CONTRIBUTING.md
  46. CONTRIBUTORS.txt
  47. fix_permissions.sh
  48. generate_descriptor_proto.sh
  49. global.json
  50. google3_export_generated_files.sh
  51. LICENSE
  52. maven_install.json
  53. MODULE.bazel
  54. PrivacyInfo.xcprivacy
  55. Protobuf-C++.podspec
  56. protobuf.bzl
  57. Protobuf.podspec
  58. protobuf_deps.bzl
  59. protobuf_release.bzl
  60. protobuf_version.bzl
  61. README.md
  62. regenerate_stale_files.sh
  63. SECURITY.md
  64. version.json
  65. WORKSPACE
  66. WORKSPACE.bzlmod
README.md

Protocol Buffers - Google's data interchange format

OpenSSF Scorecard

Copyright 2023 Google LLC

Overview

Protocol Buffers (a.k.a., protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. You can learn more about it in protobuf's documentation.

This README file contains protobuf installation instructions. To install protobuf, you need to install the protocol compiler (used to compile .proto files) and the protobuf runtime for your chosen programming language.

Working With Protobuf Source Code

Most users will find working from supported releases to be the easiest path.

If you choose to work from the head revision of the main branch your build will occasionally be broken by source-incompatible changes and insufficiently-tested (and therefore broken) behavior.

If you are using C++ or otherwise need to build protobuf from source as a part of your project, you should pin to a release commit on a release branch.

This is because even release branches can experience some instability in between release commits.

Protobuf Compiler Installation

The protobuf compiler is written in C++. If you are using C++, please follow the C++ Installation Instructions to install protoc along with the C++ runtime.

For non-C++ users, the simplest way to install the protocol compiler is to download a pre-built binary from our GitHub release page.

In the downloads section of each release, you can find pre-built binaries in zip packages: protoc-$VERSION-$PLATFORM.zip. It contains the protoc binary as well as a set of standard .proto files distributed along with protobuf.

If you are looking for an old version that is not available in the release page, check out the Maven repository.

These pre-built binaries are only provided for released versions. If you want to use the github main version at HEAD, or you need to modify protobuf code, or you are using C++, it's recommended to build your own protoc binary from source.

If you would like to build protoc binary from source, see the C++ Installation Instructions.

Protobuf Runtime Installation

Protobuf supports several different programming languages. For each programming language, you can find instructions in the corresponding source directory about how to install protobuf runtime for that specific language:

LanguageSource
C++ (include C++ runtime and protoc)src
Javajava
Pythonpython
Objective-Cobjectivec
C#csharp
Rubyruby
Goprotocolbuffers/protobuf-go
PHPphp
Dartdart-lang/protobuf
JavaScriptprotocolbuffers/protobuf-javascript

Quick Start

The best way to learn how to use protobuf is to follow the tutorials in our developer guide.

If you want to learn from code examples, take a look at the examples in the examples directory.

Documentation

The complete documentation is available at the Protocol Buffers doc site.

Support Policy

Read about our version support policy to stay current on support timeframes for the language libraries.

Developer Community

To be alerted to upcoming changes in Protocol Buffers and connect with protobuf developers and users, join the Google Group.