1Protocol Buffers - Google's data interchange format 2Copyright 2008 Google Inc. 3 4This directory contains the Java Protocol Buffers runtime library. 5 6Installation - With Maven 7========================= 8 9The Protocol Buffers build is managed using Maven. If you would 10rather build without Maven, see below. 11 121) Install Apache Maven if you don't have it: 13 14 http://maven.apache.org/ 15 162) 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: 19 20 $ protoc --version 21 22 You will need to place the protoc executable in ../src. (If you 23 built it yourself, it should already be there.) 24 253) Run the tests: 26 27 $ mvn test 28 29 If some tests fail, this library may not work correctly on your 30 system. Continue at your own risk. 31 324) Install the library into your Maven repository: 33 34 $ mvn install 35 365) If you do not use Maven to manage your own build, you can build a 37 .jar file to use: 38 39 $ mvn package 40 41 The .jar will be placed in the "target" directory. 42 43Installation - 'Lite' Version - With Maven 44========================================== 45 46Building the 'lite' version of the Java Protocol Buffers library is 47the same as building the full version, except that all commands are 48run using the 'lite' profile. (see 49http://maven.apache.org/guides/introduction/introduction-to-profiles.html) 50 51E.g. to install the lite version of the jar, you would run: 52 53 $ mvn install -P lite 54 55The resulting artifact has the 'lite' classifier. To reference it 56for dependency resolution, you would specify it as: 57 58 <dependency> 59 <groupId>com.google.protobuf</groupId> 60 <artifactId>protobuf-java</artifactId> 61 <version>${version}</version> 62 <classifier>lite</classifier> 63 </dependency> 64 65Installation - Without Maven 66============================ 67 68If you would rather not install Maven to build the library, you may 69follow these instructions instead. Note that these instructions skip 70running unit tests. 71 721) 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: 75 76 $ protoc --version 77 78 If you built the C++ code without installing, the compiler binary 79 should be located in ../src. 80 812) Invoke protoc to build DescriptorProtos.java: 82 83 $ protoc --java_out=src/main/java -I../src \ 84 ../src/google/protobuf/descriptor.proto 85 863) Compile the code in src/main/java using whatever means you prefer. 87 884) Install the classes wherever you prefer. 89 90Usage 91===== 92 93The complete documentation for Protocol Buffers is available via the 94web at: 95 96 http://code.google.com/apis/protocolbuffers/ 97