1 Protocol Buffers - Google's data interchange format
2 Copyright 2008 Google Inc.
4 This directory contains the Java Protocol Buffers runtime library.
6 Installation - With Maven
7 =========================
9 The Protocol Buffers build is managed using Maven. If you would
10 rather build without Maven, see below.
12 1) Install Apache Maven if you don't have it:
14 http://maven.apache.org/
16 2) Build the C++ code, or obtain a binary distribution of protoc. If
17 you install a binary distribution, make sure that it is the same
18 version as this package. If in doubt, run:
22 You will need to place the protoc executable in ../src. (If you
23 built it yourself, it should already be there.)
29 If some tests fail, this library may not work correctly on your
30 system. Continue at your own risk.
32 4) Install the library into your Maven repository:
36 5) If you do not use Maven to manage your own build, you can build a
41 The .jar will be placed in the "target" directory.
43 Installation - 'Lite' Version - With Maven
44 ==========================================
46 Building the 'lite' version of the Java Protocol Buffers library is
47 the same as building the full version, except that all commands are
48 run using the 'lite' profile. (see
49 http://maven.apache.org/guides/introduction/introduction-to-profiles.html)
51 E.g. to install the lite version of the jar, you would run:
55 The resulting artifact has the 'lite' classifier. To reference it
56 for dependency resolution, you would specify it as:
59 <groupId>com.google.protobuf</groupId>
60 <artifactId>protobuf-java</artifactId>
61 <version>${version}</version>
62 <classifier>lite</classifier>
65 Installation - Without Maven
66 ============================
68 If you would rather not install Maven to build the library, you may
69 follow these instructions instead. Note that these instructions skip
72 1) Build the C++ code, or obtain a binary distribution of protoc. If
73 you install a binary distribution, make sure that it is the same
74 version as this package. If in doubt, run:
78 If you built the C++ code without installing, the compiler binary
79 should be located in ../src.
81 2) Invoke protoc to build DescriptorProtos.java:
83 $ protoc --java_out=src/main/java -I../src \
84 ../src/google/protobuf/descriptor.proto
86 3) Compile the code in src/main/java using whatever means you prefer.
88 4) Install the classes wherever you prefer.
93 The complete documentation for Protocol Buffers is available via the
96 https://developers.google.com/protocol-buffers/