pom.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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/maven-v4_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.11.4</version>
  8. </parent>
  9. <artifactId>protobuf-java</artifactId>
  10. <packaging>bundle</packaging>
  11. <name>Protocol Buffers [Core]</name>
  12. <description>
  13. Core Protocol Buffers library. Protocol Buffers are a way of encoding structured data in an
  14. efficient yet extensible format.
  15. </description>
  16. <dependencies>
  17. <dependency>
  18. <groupId>junit</groupId>
  19. <artifactId>junit</artifactId>
  20. <scope>test</scope>
  21. </dependency>
  22. <dependency>
  23. <groupId>org.easymock</groupId>
  24. <artifactId>easymock</artifactId>
  25. <scope>test</scope>
  26. </dependency>
  27. <dependency>
  28. <groupId>org.easymock</groupId>
  29. <artifactId>easymockclassextension</artifactId>
  30. <scope>test</scope>
  31. </dependency>
  32. <dependency>
  33. <groupId>com.google.guava</groupId>
  34. <artifactId>guava</artifactId>
  35. <scope>test</scope>
  36. </dependency>
  37. <dependency>
  38. <groupId>com.google.truth</groupId>
  39. <artifactId>truth</artifactId>
  40. <scope>test</scope>
  41. </dependency>
  42. </dependencies>
  43. <build>
  44. <!-- Include core protos in the bundle as resources -->
  45. <resources>
  46. <resource>
  47. <directory>${protobuf.source.dir}</directory>
  48. <includes>
  49. <include>google/protobuf/any.proto</include>
  50. <include>google/protobuf/api.proto</include>
  51. <include>google/protobuf/descriptor.proto</include>
  52. <include>google/protobuf/duration.proto</include>
  53. <include>google/protobuf/empty.proto</include>
  54. <include>google/protobuf/field_mask.proto</include>
  55. <include>google/protobuf/source_context.proto</include>
  56. <include>google/protobuf/struct.proto</include>
  57. <include>google/protobuf/timestamp.proto</include>
  58. <include>google/protobuf/type.proto</include>
  59. <include>google/protobuf/wrappers.proto</include>
  60. <include>google/protobuf/compiler/plugin.proto</include>
  61. </includes>
  62. </resource>
  63. </resources>
  64. <testResources>
  65. <testResource>
  66. <directory>${protobuf.source.dir}</directory>
  67. <includes>
  68. <include>google/protobuf/testdata/golden_message_oneof_implemented</include>
  69. <include>google/protobuf/testdata/golden_packed_fields_message</include>
  70. </includes>
  71. </testResource>
  72. </testResources>
  73. <plugins>
  74. <!-- Use Antrun plugin to generate sources with protoc -->
  75. <plugin>
  76. <artifactId>maven-antrun-plugin</artifactId>
  77. <executions>
  78. <!-- Generate core protos -->
  79. <execution>
  80. <id>generate-sources</id>
  81. <phase>generate-sources</phase>
  82. <configuration>
  83. <target>
  84. <ant antfile="generate-sources-build.xml"/>
  85. </target>
  86. </configuration>
  87. <goals>
  88. <goal>run</goal>
  89. </goals>
  90. </execution>
  91. <!-- Generate the test protos -->
  92. <execution>
  93. <id>generate-test-sources</id>
  94. <phase>generate-test-sources</phase>
  95. <configuration>
  96. <target>
  97. <ant antfile="generate-test-sources-build.xml"/>
  98. </target>
  99. </configuration>
  100. <goals>
  101. <goal>run</goal>
  102. </goals>
  103. </execution>
  104. </executions>
  105. </plugin>
  106. <!-- Add the generated sources to the build -->
  107. <plugin>
  108. <groupId>org.codehaus.mojo</groupId>
  109. <artifactId>build-helper-maven-plugin</artifactId>
  110. <executions>
  111. <execution>
  112. <id>add-generated-sources</id>
  113. <phase>generate-sources</phase>
  114. <goals>
  115. <goal>add-source</goal>
  116. </goals>
  117. <configuration>
  118. <sources>
  119. <source>${generated.sources.dir}</source>
  120. </sources>
  121. </configuration>
  122. </execution>
  123. <execution>
  124. <id>add-generated-test-sources</id>
  125. <phase>generate-test-sources</phase>
  126. <goals>
  127. <goal>add-test-source</goal>
  128. </goals>
  129. <configuration>
  130. <sources>
  131. <source>${generated.testsources.dir}</source>
  132. </sources>
  133. </configuration>
  134. </execution>
  135. </executions>
  136. </plugin>
  137. <!-- OSGI bundle configuration -->
  138. <plugin>
  139. <groupId>org.apache.felix</groupId>
  140. <artifactId>maven-bundle-plugin</artifactId>
  141. <extensions>true</extensions>
  142. <configuration>
  143. <instructions>
  144. <Automatic-Module-Name>com.google.protobuf</Automatic-Module-Name> <!-- Java9+ Jigsaw module name -->
  145. <Bundle-DocURL>https://developers.google.com/protocol-buffers/</Bundle-DocURL>
  146. <Bundle-SymbolicName>com.google.protobuf</Bundle-SymbolicName>
  147. <Export-Package>com.google.protobuf;version=${project.version}</Export-Package>
  148. <Import-Package>sun.misc;resolution:=optional,*</Import-Package>
  149. </instructions>
  150. </configuration>
  151. </plugin>
  152. </plugins>
  153. </build>
  154. </project>