0
# Protocol Buffers BOM
1
2
Protocol Buffers BOM (Bill of Materials) is a Maven dependency management artifact that provides version coordination for Protocol Buffers Java libraries. It ensures compatible versions across protobuf-java, protobuf-java-util, and protobuf-kotlin artifacts, simplifying dependency management for Java projects using Protocol Buffers.
3
4
## Package Information
5
6
- **Package Name**: protobuf-bom
7
- **Package Type**: Maven BOM (Bill of Materials)
8
- **Group ID**: com.google.protobuf
9
- **Artifact ID**: protobuf-bom
10
- **Version**: 4.31.1
11
- **Language**: Java (Maven)
12
- **Installation**: Add to Maven `<dependencyManagement>` section
13
14
## Core Usage
15
16
Import the BOM in your Maven project's dependency management section:
17
18
```xml
19
<dependencyManagement>
20
<dependencies>
21
<dependency>
22
<groupId>com.google.protobuf</groupId>
23
<artifactId>protobuf-bom</artifactId>
24
<version>4.31.1</version>
25
<type>pom</type>
26
<scope>import</scope>
27
</dependency>
28
</dependencies>
29
</dependencyManagement>
30
```
31
32
## Basic Usage
33
34
After importing the BOM, declare Protocol Buffers dependencies without specifying versions:
35
36
```xml
37
<dependencies>
38
<!-- Core Protocol Buffers Java library -->
39
<dependency>
40
<groupId>com.google.protobuf</groupId>
41
<artifactId>protobuf-java</artifactId>
42
<!-- version inherited from BOM -->
43
</dependency>
44
45
<!-- Protocol Buffers utilities (JsonFormat, etc.) -->
46
<dependency>
47
<groupId>com.google.protobuf</groupId>
48
<artifactId>protobuf-java-util</artifactId>
49
<!-- version inherited from BOM -->
50
</dependency>
51
52
<!-- Protocol Buffers Kotlin support -->
53
<dependency>
54
<groupId>com.google.protobuf</groupId>
55
<artifactId>protobuf-kotlin</artifactId>
56
<!-- version inherited from BOM -->
57
</dependency>
58
</dependencies>
59
```
60
61
## Capabilities
62
63
### Dependency Version Management
64
65
Coordinates versions for all Protocol Buffers Java libraries to ensure compatibility.
66
67
```xml { .api }
68
<!-- BOM Import Configuration -->
69
<dependency>
70
<groupId>com.google.protobuf</groupId>
71
<artifactId>protobuf-bom</artifactId>
72
<version>4.31.1</version>
73
<type>pom</type>
74
<scope>import</scope>
75
</dependency>
76
```
77
78
### Managed Dependencies
79
80
The BOM manages versions for the following Protocol Buffers artifacts:
81
82
```xml { .api }
83
<!-- Managed: Core Protocol Buffers Java Runtime -->
84
<dependency>
85
<groupId>com.google.protobuf</groupId>
86
<artifactId>protobuf-java</artifactId>
87
<!-- version: 4.31.1 -->
88
</dependency>
89
90
<!-- Managed: Protocol Buffers Java Utilities -->
91
<dependency>
92
<groupId>com.google.protobuf</groupId>
93
<artifactId>protobuf-java-util</artifactId>
94
<!-- version: 4.31.1 -->
95
</dependency>
96
97
<!-- Managed: Protocol Buffers Kotlin Support -->
98
<dependency>
99
<groupId>com.google.protobuf</groupId>
100
<artifactId>protobuf-kotlin</artifactId>
101
<!-- version: 4.31.1 -->
102
</dependency>
103
```
104
105
### Version Coordination
106
107
Ensures all Protocol Buffers artifacts use compatible versions automatically.
108
109
```xml { .api }
110
<!-- All these dependencies will use version 4.31.1 -->
111
<dependencies>
112
<dependency>
113
<groupId>com.google.protobuf</groupId>
114
<artifactId>protobuf-java</artifactId>
115
</dependency>
116
<dependency>
117
<groupId>com.google.protobuf</groupId>
118
<artifactId>protobuf-java-util</artifactId>
119
</dependency>
120
<dependency>
121
<groupId>com.google.protobuf</groupId>
122
<artifactId>protobuf-kotlin</artifactId>
123
</dependency>
124
</dependencies>
125
```
126
127
## Managed Artifacts
128
129
### protobuf-java
130
131
**Type**: Core Runtime Library
132
**Group ID**: com.google.protobuf
133
**Artifact ID**: protobuf-java
134
**Managed Version**: 4.31.1
135
**Description**: Core Protocol Buffers Java runtime library providing message serialization and deserialization capabilities.
136
137
### protobuf-java-util
138
139
**Type**: Utility Library
140
**Group ID**: com.google.protobuf
141
**Artifact ID**: protobuf-java-util
142
**Managed Version**: 4.31.1
143
**Description**: Protocol Buffers Java utility library including JsonFormat for JSON serialization and other helpful utilities.
144
145
### protobuf-kotlin
146
147
**Type**: Kotlin Language Bindings
148
**Group ID**: com.google.protobuf
149
**Artifact ID**: protobuf-kotlin
150
**Managed Version**: 4.31.1
151
**Description**: Protocol Buffers Kotlin language bindings providing idiomatic Kotlin APIs for Protocol Buffers usage.
152
153
## Related Artifacts
154
155
The following Protocol Buffers artifacts are available but are NOT managed by this BOM and require explicit version specification:
156
157
### protobuf-javalite
158
159
**Group ID**: com.google.protobuf
160
**Artifact ID**: protobuf-javalite
161
**Description**: Lightweight Protocol Buffers Java runtime optimized for Android and resource-constrained environments. Smaller size but with limited reflection capabilities.
162
163
**Usage**:
164
```xml
165
<dependency>
166
<groupId>com.google.protobuf</groupId>
167
<artifactId>protobuf-javalite</artifactId>
168
<version>4.31.1</version> <!-- explicit version required -->
169
</dependency>
170
```
171
172
### protobuf-kotlin-lite
173
174
**Group ID**: com.google.protobuf
175
**Artifact ID**: protobuf-kotlin-lite
176
**Description**: Lightweight Protocol Buffers Kotlin language bindings optimized for Android and resource-constrained environments.
177
178
**Usage**:
179
```xml
180
<dependency>
181
<groupId>com.google.protobuf</groupId>
182
<artifactId>protobuf-kotlin-lite</artifactId>
183
<version>4.31.1</version> <!-- explicit version required -->
184
</dependency>
185
```
186
187
## Project Metadata
188
189
```xml { .api }
190
<!-- Project Coordinates -->
191
<groupId>com.google.protobuf</groupId>
192
<artifactId>protobuf-bom</artifactId>
193
<version>4.31.1</version>
194
<packaging>pom</packaging>
195
196
<!-- Project Information -->
197
<name>Protocol Buffers [BOM]</name>
198
<description>A compatible set of open source libraries for working with protocol buffers.</description>
199
<url>https://developers.google.com/protocol-buffers/</url>
200
201
<!-- Organization -->
202
<organization>
203
<name>Google LLC</name>
204
<url>https://protobuf.dev</url>
205
</organization>
206
207
<!-- License -->
208
<license>
209
<name>BSD-3-Clause</name>
210
<url>https://opensource.org/licenses/BSD-3-Clause</url>
211
</license>
212
213
<!-- Source Control -->
214
<scm>
215
<url>https://github.com/protocolbuffers/protobuf</url>
216
<connection>scm:git:https://github.com/protocolbuffers/protobuf.git</connection>
217
</scm>
218
```