pom.xml 5.3 KB

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