1Protocol Buffers - Google's data interchange format 2=================================================== 3 4[![Build Status](https://travis-ci.org/google/protobuf.svg?branch=master)](https://travis-ci.org/google/protobuf) 5 6Copyright 2008 Google Inc. 7 8This directory contains the Java Protocol Buffers runtime library. 9 10Installation - With Maven 11========================= 12 13The Protocol Buffers build is managed using Maven. If you would 14rather build without Maven, see below. 15 161) Install Apache Maven if you don't have it: 17 18 http://maven.apache.org/ 19 202) Build the C++ code, or obtain a binary distribution of protoc. If 21 you install a binary distribution, make sure that it is the same 22 version as this package. If in doubt, run: 23 24 $ protoc --version 25 26 You will need to place the protoc executable in ../src. (If you 27 built it yourself, it should already be there.) 28 293) Run the tests: 30 31 $ mvn test 32 33 If some tests fail, this library may not work correctly on your 34 system. Continue at your own risk. 35 364) Install the library into your Maven repository: 37 38 $ mvn install 39 405) If you do not use Maven to manage your own build, you can build a 41 .jar file to use: 42 43 $ mvn package 44 45 The .jar will be placed in the "target" directory. 46 47Installation - 'Lite' Version - With Maven 48========================================== 49 50Building the 'lite' version of the Java Protocol Buffers library is 51the same as building the full version, except that all commands are 52run using the 'lite' profile. (see 53http://maven.apache.org/guides/introduction/introduction-to-profiles.html) 54 55E.g. to install the lite version of the jar, you would run: 56 57 $ mvn install -P lite 58 59The resulting artifact has the 'lite' classifier. To reference it 60for dependency resolution, you would specify it as: 61 62``` 63 <dependency> 64 <groupId>com.google.protobuf</groupId> 65 <artifactId>protobuf-java</artifactId> 66 <version>${version}</version> 67 <classifier>lite</classifier> 68 </dependency> 69``` 70 71Installation - Without Maven 72============================ 73 74If you would rather not install Maven to build the library, you may 75follow these instructions instead. Note that these instructions skip 76running unit tests. 77 781) Build the C++ code, or obtain a binary distribution of protoc. If 79 you install a binary distribution, make sure that it is the same 80 version as this package. If in doubt, run: 81 82 $ protoc --version 83 84 If you built the C++ code without installing, the compiler binary 85 should be located in ../src. 86 872) Invoke protoc to build DescriptorProtos.java: 88 89 $ protoc --java_out=src/main/java -I../src \ 90 ../src/google/protobuf/descriptor.proto 91 923) Compile the code in src/main/java using whatever means you prefer. 93 944) Install the classes wherever you prefer. 95 96Usage 97===== 98 99The complete documentation for Protocol Buffers is available via the 100web at: 101 102 https://developers.google.com/protocol-buffers/ 103