This document describes how Protocol Buffers artifacts are packaged and distributed across different language ecosystems and package managers. It covers the structure of language-specific packages, version coordination, platform-specific binaries, and the release automation infrastructure. For information about the build systems that generate these artifacts, see Bazel Build System and CMake and Other Build Systems. For language-specific runtime implementations, see Language Implementations.
Protocol Buffers distributes compiled artifacts through seven major package ecosystems, each following platform-specific conventions while maintaining version synchronization and wire-format compatibility.
Sources: java/pom.xml7 csharp/src/Google.Protobuf/Google.Protobuf.csproj8 csharp/Google.Protobuf.Tools.nuspec8 python/google/protobuf/__init__.py10 ruby/google-protobuf.gemspec3 php/ext/google/protobuf/protobuf.h25 Protobuf.podspec8
Protocol Buffers publishes Java artifacts to Maven Central using a multi-module structure managed by a parent POM with version coordination through a Bill of Materials (BOM).
Maven Parent POM Configuration:
| Property | Value | Purpose |
|---|---|---|
groupId | com.google.protobuf | Maven group identifier java/pom.xml5 |
version | 4.36.0 | Synchronized across all modules java/pom.xml7 |
packaging | pom | Parent-only, no artifacts java/pom.xml8 |
scm.url | https://github.com/protocolbuffers/protobuf | Source repository java/pom.xml52 |
distributionManagement | sonatype-nexus-staging | Nexus staging repository java/pom.xml56-65 |
The parent POM at java/pom.xml1-207 defines shared plugin configurations, dependency versions, and distribution settings inherited by all child modules.
The protobuf-bom artifact at java/bom/pom.xml1-116 provides version management for consumers. It imports the project version into the dependency management block java/bom/pom.xml36-42 to ensure consistent versions across all Protocol Buffers dependencies without explicitly specifying version numbers for each artifact.
| Module | Artifact ID | Purpose | Target Platform |
|---|---|---|---|
| Core | protobuf-java | Full runtime with reflection | Java 8+ java/pom.xml115-116 |
| Lite | protobuf-java-lite | Minimal runtime for Android | Java 8+ / Android java/pom.xml187-190 |
| Util | protobuf-java-util | JSON conversion utilities | Java 8+ |
| Kotlin | protobuf-kotlin | Kotlin DSL extensions | Java 8+ / Kotlin |
The parent POM includes a release profile at java/pom.xml209-215 that enables:
maven-gpg-plugin for secure distribution.maven-source-plugin java/pom.xml120-130maven-javadoc-plugin java/pom.xml132-145distributionManagement java/pom.xml56-65Sources: java/pom.xml1-215 java/bom/pom.xml1-116
C# artifacts are distributed as NuGet packages through two complementary packages: a runtime library and a tools package containing platform-specific protoc binaries.
The Google.Protobuf runtime library at csharp/src/Google.Protobuf/Google.Protobuf.csproj1-47 targets modern .NET frameworks:
| Target Framework | Purpose | Features |
|---|---|---|
netstandard2.0 | Modern .NET Standard | Standard library support csharp/src/Google.Protobuf/Google.Protobuf.csproj11 |
net8.0 | Latest .NET | SIMD optimizations via GOOGLE_PROTOBUF_SIMD csharp/src/Google.Protobuf/Google.Protobuf.csproj33 |
Key Properties:
3.36.0 at csharp/src/Google.Protobuf/Google.Protobuf.csproj8Google.Protobuf.snk csharp/src/Google.Protobuf/Google.Protobuf.csproj13-14<IsTrimmable>true</IsTrimmable> for AOT compilation csharp/src/Google.Protobuf/Google.Protobuf.csproj25Microsoft.SourceLink.GitHub csharp/src/Google.Protobuf/Google.Protobuf.csproj37The Google.Protobuf.Tools package at csharp/Google.Protobuf.Tools.nuspec1-61 bundles:
Platform-Specific protoc Binaries: Bundled for Windows (x86/x64), Linux (x86/x64/aarch64), and macOS (x64) csharp/Google.Protobuf.Tools.nuspec19-24
Well-Known Type Definitions: All .proto files from src/google/protobuf/ installed to two locations for compatibility csharp/Google.Protobuf.Tools.nuspec29-56:
tools/include/google/protobuf/ — Modern protoc search path.tools/google/protobuf/ — Legacy location for backward compatibility.MSBuild Integration: Google.Protobuf.Tools.targets file automatically selects the appropriate protoc binary based on the build platform csharp/Google.Protobuf.Tools.nuspec58-59
Sources: csharp/src/Google.Protobuf/Google.Protobuf.csproj1-47 csharp/Google.Protobuf.Tools.nuspec1-61
Python packages are distributed as binary wheels and source distributions, supporting optimized C++ and UPB backends.
The Python package version 7.36.0 is defined at python/google/protobuf/__init__.py10
Package Artifacts:
google/protobuf python/dist/BUILD.bazel249-258google._upb._message module is built from //python:_message_binary python/dist/BUILD.bazel22-26utf8_range are bundled for native validation python/dist/BUILD.bazel269-273The setup.py and MANIFEST.in files are managed via dist_source_files python/dist/BUILD.bazel275-280 The build system generates platform-specific configurations for:
Sources: python/google/protobuf/__init__.py10 python/dist/BUILD.bazel1-300
Ruby distributes a single google-protobuf gem that adapts to CRuby and JRuby.
The gemspec at ruby/google-protobuf.gemspec1-54 handles multi-platform support:
| Platform | Detection | Features |
|---|---|---|
| CRuby | RUBY_PLATFORM != "java" | Bundles native extensions and extconf.rb ruby/google-protobuf.gemspec25-39 |
| JRuby | RUBY_PLATFORM == "java" | Bundles protobuf_java.jar and uses ffi ruby/google-protobuf.gemspec14-23 |
Key Attributes:
4.36.0 ruby/google-protobuf.gemspec3>= 3.1 ruby/google-protobuf.gemspec41bigdecimal and rake ruby/google-protobuf.gemspec43-48Sources: ruby/google-protobuf.gemspec1-54
PHP distributes a native extension through PECL, wrapping the UPB runtime for high performance.
The extension version is 5.36.0 php/ext/google/protobuf/protobuf.h25 It uses an Object Cache to maintain a weak map between upb pointers and PHP objects php/ext/google/protobuf/protobuf.h27-42:
upb_Message* → Messageupb_Array* → RepeatedFieldupb_Map* → MapFieldName Mapping: Since the protobuf-to-PHP name transformation is non-reversible, the extension maintains a NameMap to look up upb_MessageDef and upb_EnumDef by PHP class entry php/ext/google/protobuf/protobuf.h44-54
Sources: php/ext/google/protobuf/protobuf.h1-78
Objective-C support is distributed through the Protobuf pod, covering Apple platforms.
The specification at Protobuf.podspec1-53 defines:
5.36.0 Protobuf.podspec8v5.36.0-objectivec Protobuf.podspec18-19Build Configuration:
PrivacyInfo.xcprivacy Protobuf.podspec29-31GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 for proper header resolution Protobuf.podspec34-35Sources: Protobuf.podspec1-53
The pkg/ directory contains Bazel rules for generating standardized release artifacts.
The protoc_release target pkg/BUILD.bazel89-99 bundles:
protoc or protoc.exe depending on the host pkg/BUILD.bazel78-87readme.txt with installation instructions pkg/BUILD.bazel42-60Bazel generates source-distribution libraries for the C++ runtime:
protobuf_lite: Minimal runtime with -lpthread link options pkg/BUILD.bazel163-174protobuf: Full runtime including JSON, util, and importer modules pkg/BUILD.bazel176-195The CMake install logic cmake/install.cmake1-175 handles the complex task of stripping prefixes from headers during installation:
/src, /java/core/src/main/resources, /csharp, and /go cmake/install.cmake122-128protobuf_HEADERS to find the correct source directory and installs them to CMAKE_INSTALL_INCLUDEDIR cmake/install.cmake129-151Refresh this wiki