pom.xml 5.2 KB

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