1<?xml version="1.0" encoding="UTF-8"?> 2<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 3 <modelVersion>4.0.0</modelVersion> 4 <parent> 5 <groupId>com.google.protobuf</groupId> 6 <artifactId>protobuf-parent</artifactId> 7 <version>3.9.1</version> 8 </parent> 9 10 <artifactId>protobuf-javalite</artifactId> 11 <packaging>bundle</packaging> 12 13 <name>Protocol Buffers [Lite]</name> 14 <description> 15 Lite version of Protocol Buffers library. This version is optimized for code size, but does 16 not guarantee API/ABI stability. 17 </description> 18 19 <dependencies> 20 <dependency> 21 <groupId>junit</groupId> 22 <artifactId>junit</artifactId> 23 <scope>test</scope> 24 </dependency> 25 <dependency> 26 <groupId>org.easymock</groupId> 27 <artifactId>easymock</artifactId> 28 <scope>test</scope> 29 </dependency> 30 <dependency> 31 <groupId>org.easymock</groupId> 32 <artifactId>easymockclassextension</artifactId> 33 <scope>test</scope> 34 </dependency> 35 <dependency> 36 <groupId>com.google.guava</groupId> 37 <artifactId>guava</artifactId> 38 <scope>test</scope> 39 </dependency> 40 </dependencies> 41 42 <build> 43 <!-- Include core protos in the bundle as resources --> 44 <resources> 45 <resource> 46 <directory>${protobuf.source.dir}</directory> 47 <includes> 48 <include>google/protobuf/any.proto</include> 49 <include>google/protobuf/api.proto</include> 50 <include>google/protobuf/empty.proto</include> 51 <include>google/protobuf/field_mask.proto</include> 52 <include>google/protobuf/source_context.proto</include> 53 <include>google/protobuf/struct.proto</include> 54 <include>google/protobuf/timestamp.proto</include> 55 <include>google/protobuf/type.proto</include> 56 <include>google/protobuf/wrappers.proto</include> 57 </includes> 58 </resource> 59 </resources> 60 <testResources> 61 <testResource> 62 <directory>${protobuf.source.dir}</directory> 63 <includes> 64 <include>google/protobuf/testdata/golden_message_oneof_implemented</include> 65 <include>google/protobuf/testdata/golden_packed_fields_message</include> 66 </includes> 67 </testResource> 68 </testResources> 69 70 <plugins> 71 <plugin> 72 <artifactId>maven-resources-plugin</artifactId> 73 <version>3.1.0</version> 74 <executions> 75 <execution> 76 <id>copy-source-files</id> 77 <phase>generate-sources</phase> 78 <goals> 79 <goal>copy-resources</goal> 80 </goals> 81 <configuration> 82 <outputDirectory>${generated.sources.dir}/com/google/protobuf</outputDirectory> 83 <resources> 84 <resource> 85 <directory>${basedir}/../core/src/main/java/com/google/protobuf</directory> 86 <includes> 87 <!-- Keep in sync with //:BUILD --> 88 <include>AbstractMessageLite.java</include> 89 <include>AbstractParser.java</include> 90 <include>AbstractProtobufList.java</include> 91 <include>AllocatedBuffer.java</include> 92 <include>Android.java</include> 93 <include>ArrayDecoders.java</include> 94 <include>BinaryReader.java</include> 95 <include>BinaryWriter.java</include> 96 <include>BooleanArrayList.java</include> 97 <include>BufferAllocator.java</include> 98 <include>ByteBufferWriter.java</include> 99 <include>ByteOutput.java</include> 100 <include>ByteString.java</include> 101 <include>CodedInputStream.java</include> 102 <include>CodedInputStreamReader.java</include> 103 <include>CodedOutputStream.java</include> 104 <include>CodedOutputStreamWriter.java</include> 105 <include>DoubleArrayList.java</include> 106 <include>ExperimentalApi.java</include> 107 <include>ExtensionLite.java</include> 108 <include>ExtensionRegistryFactory.java</include> 109 <include>ExtensionRegistryLite.java</include> 110 <include>ExtensionSchema.java</include> 111 <include>ExtensionSchemaLite.java</include> 112 <include>ExtensionSchemas.java</include> 113 <include>FieldInfo.java</include> 114 <include>FieldSet.java</include> 115 <include>FieldType.java</include> 116 <include>FloatArrayList.java</include> 117 <include>GeneratedMessageInfoFactory.java</include> 118 <include>GeneratedMessageLite.java</include> 119 <include>IntArrayList.java</include> 120 <include>Internal.java</include> 121 <include>InvalidProtocolBufferException.java</include> 122 <include>IterableByteBufferInputStream.java</include> 123 <include>JavaType.java</include> 124 <include>LazyField.java</include> 125 <include>LazyFieldLite.java</include> 126 <include>LazyStringArrayList.java</include> 127 <include>LazyStringList.java</include> 128 <include>ListFieldSchema.java</include> 129 <include>LongArrayList.java</include> 130 <include>ManifestSchemaFactory.java</include> 131 <include>MapEntryLite.java</include> 132 <include>MapFieldLite.java</include> 133 <include>MapFieldSchema.java</include> 134 <include>MapFieldSchemaLite.java</include> 135 <include>MapFieldSchemas.java</include> 136 <include>MessageInfo.java</include> 137 <include>MessageInfoFactory.java</include> 138 <include>MessageLite.java</include> 139 <include>MessageLiteOrBuilder.java</include> 140 <include>MessageLiteToString.java</include> 141 <include>MessageSchema.java</include> 142 <include>MessageSetSchema.java</include> 143 <include>MutabilityOracle.java</include> 144 <include>NewInstanceSchema.java</include> 145 <include>NewInstanceSchemaLite.java</include> 146 <include>NewInstanceSchemas.java</include> 147 <include>NioByteString.java</include> 148 <include>OneofInfo.java</include> 149 <include>Parser.java</include> 150 <include>PrimitiveNonBoxingCollection.java</include> 151 <include>ProtoSyntax.java</include> 152 <include>Protobuf.java</include> 153 <include>ProtobufArrayList.java</include> 154 <include>ProtobufLists.java</include> 155 <include>ProtocolStringList.java</include> 156 <include>RawMessageInfo.java</include> 157 <include>Reader.java</include> 158 <include>RopeByteString.java</include> 159 <include>Schema.java</include> 160 <include>SchemaFactory.java</include> 161 <include>SchemaUtil.java</include> 162 <include>SmallSortedMap.java</include> 163 <include>StructuralMessageInfo.java</include> 164 <include>TextFormatEscaper.java</include> 165 <include>UninitializedMessageException.java</include> 166 <include>UnknownFieldSchema.java</include> 167 <include>UnknownFieldSetLite.java</include> 168 <include>UnknownFieldSetLiteSchema.java</include> 169 <include>UnmodifiableLazyStringList.java</include> 170 <include>UnsafeUtil.java</include> 171 <include>Utf8.java</include> 172 <include>WireFormat.java</include> 173 <include>Writer.java</include> 174 </includes> 175 </resource> 176 </resources> 177 </configuration> 178 </execution> 179 <execution> 180 <id>copy-test-source-files</id> 181 <phase>generate-test-sources</phase> 182 <goals> 183 <goal>copy-resources</goal> 184 </goals> 185 <configuration> 186 <outputDirectory>${generated.testsources.dir}/com/google/protobuf</outputDirectory> 187 <resources> 188 <resource> 189 <directory>${basedir}/../core/src/test/java/com/google/protobuf</directory> 190 <!-- For sources, we want to be explicit about what we add so we don't accidentally 191 increase the size of the lite runtime library. For tests, we want to be defensive 192 and exclude only the full runtime exclusive tests so we don't accidentally miss 193 any test. --> 194 <excludes> 195 <exclude>AbstractMessageTest.java</exclude> 196 <exclude>AbstractProto2SchemaTest.java</exclude> 197 <exclude>AnyTest.java</exclude> 198 <exclude>CodedInputStreamTest.java</exclude> 199 <exclude>DeprecatedFieldTest.java</exclude> 200 <exclude>DescriptorsTest.java</exclude> 201 <exclude>DiscardUnknownFieldsTest.java</exclude> 202 <exclude>DynamicMessageTest.java</exclude> 203 <exclude>ExtensionRegistryFactoryTest.java</exclude> 204 <exclude>FieldPresenceTest.java</exclude> 205 <exclude>ForceFieldBuildersPreRun.java</exclude> 206 <exclude>GeneratedMessageTest.java</exclude> 207 <exclude>LazyFieldTest.java</exclude> 208 <exclude>LazyStringEndToEndTest.java</exclude> 209 <exclude>MapForProto2Test.java</exclude> 210 <exclude>MapTest.java</exclude> 211 <exclude>MessageTest.java</exclude> 212 <exclude>NestedBuildersTest.java</exclude> 213 <exclude>PackedFieldTest.java</exclude> 214 <exclude>ParserTest.java</exclude> 215 <exclude>ParseExceptionsTest.java</exclude> 216 <exclude>Proto2ExtensionLookupSchemaTest.java</exclude> 217 <exclude>Proto2SchemaTest.java</exclude> 218 <exclude>Proto2UnknownEnumValueTest.java</exclude> 219 <exclude>RepeatedFieldBuilderV3Test.java</exclude> 220 <exclude>ServiceTest.java</exclude> 221 <exclude>SingleFieldBuilderV3Test.java</exclude> 222 <exclude>TestBadIdentifiers.java</exclude> 223 <exclude>TextFormatParseInfoTreeTest.java</exclude> 224 <exclude>TextFormatParseLocationTest.java</exclude> 225 <exclude>TextFormatTest.java</exclude> 226 <exclude>TestUtil.java</exclude> 227 <exclude>UnknownEnumValueTest.java</exclude> 228 <exclude>UnknownFieldSetLiteTest.java</exclude> 229 <exclude>UnknownFieldSetTest.java</exclude> 230 <exclude>WellKnownTypesTest.java</exclude> 231 <exclude>WireFormatTest.java</exclude> 232 </excludes> 233 </resource> 234 </resources> 235 </configuration> 236 </execution> 237 </executions> 238 </plugin> 239 240 <!-- Use Antrun plugin to generate sources with protoc --> 241 <plugin> 242 <artifactId>maven-antrun-plugin</artifactId> 243 <executions> 244 <!-- Generate core protos --> 245 <execution> 246 <id>generate-sources</id> 247 <phase>generate-sources</phase> 248 <configuration> 249 <target> 250 <ant antfile="generate-sources-build.xml"/> 251 </target> 252 </configuration> 253 <goals> 254 <goal>run</goal> 255 </goals> 256 </execution> 257 258 <!-- Generate the test protos --> 259 <execution> 260 <id>generate-test-sources</id> 261 <phase>generate-test-sources</phase> 262 <configuration> 263 <target> 264 <ant antfile="generate-test-sources-build.xml"/> 265 </target> 266 </configuration> 267 <goals> 268 <goal>run</goal> 269 </goals> 270 </execution> 271 272 <execution> 273 <id>process-lite-sources</id> 274 <phase>generate-test-sources</phase> 275 <configuration> 276 <target> 277 <ant antfile="process-lite-sources-build.xml"/> 278 </target> 279 </configuration> 280 <goals> 281 <goal>run</goal> 282 </goals> 283 </execution> 284 </executions> 285 </plugin> 286 287 <plugin> 288 <groupId>org.codehaus.mojo</groupId> 289 <artifactId>build-helper-maven-plugin</artifactId> 290 <executions> 291 <execution> 292 <id>add-generated-sources</id> 293 <phase>generate-sources</phase> 294 <goals> 295 <goal>add-source</goal> 296 </goals> 297 <configuration> 298 <sources> 299 <source>${generated.sources.dir}</source> 300 </sources> 301 </configuration> 302 </execution> 303 304 <execution> 305 <id>add-generated-test-sources</id> 306 <phase>generate-test-sources</phase> 307 <goals> 308 <goal>add-test-source</goal> 309 </goals> 310 <configuration> 311 <sources> 312 <source>${generated.testsources.dir}</source> 313 </sources> 314 </configuration> 315 </execution> 316 </executions> 317 </plugin> 318 319 <!-- OSGI bundle configuration --> 320 <plugin> 321 <groupId>org.apache.felix</groupId> 322 <artifactId>maven-bundle-plugin</artifactId> 323 <extensions>true</extensions> 324 <configuration> 325 <instructions> 326 <Bundle-DocURL>https://developers.google.com/protocol-buffers/</Bundle-DocURL> 327 <Bundle-SymbolicName>com.google.protobuf</Bundle-SymbolicName> 328 <Export-Package>com.google.protobuf;version=${project.version}</Export-Package> 329 <Import-Package>sun.misc;resolution:=optional,*</Import-Package> 330 </instructions> 331 </configuration> 332 </plugin> 333 </plugins> 334 </build> 335 336</project> 337