pom.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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.3.0</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.truth</groupId>
  36. <artifactId>truth</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. <plugins>
  62. <!-- Use Antrun plugin to generate sources with protoc -->
  63. <plugin>
  64. <artifactId>maven-antrun-plugin</artifactId>
  65. <executions>
  66. <!-- Generate core protos -->
  67. <execution>
  68. <id>generate-sources</id>
  69. <phase>generate-sources</phase>
  70. <configuration>
  71. <target>
  72. <ant antfile="generate-sources-build.xml"/>
  73. </target>
  74. </configuration>
  75. <goals>
  76. <goal>run</goal>
  77. </goals>
  78. </execution>
  79. <!-- Generate the test protos -->
  80. <execution>
  81. <id>generate-test-sources</id>
  82. <phase>generate-test-sources</phase>
  83. <configuration>
  84. <target>
  85. <ant antfile="generate-test-sources-build.xml"/>
  86. </target>
  87. </configuration>
  88. <goals>
  89. <goal>run</goal>
  90. </goals>
  91. </execution>
  92. </executions>
  93. </plugin>
  94. <!-- Add the generated sources to the build -->
  95. <plugin>
  96. <groupId>org.codehaus.mojo</groupId>
  97. <artifactId>build-helper-maven-plugin</artifactId>
  98. <executions>
  99. <execution>
  100. <id>add-generated-sources</id>
  101. <phase>generate-sources</phase>
  102. <goals>
  103. <goal>add-source</goal>
  104. </goals>
  105. <configuration>
  106. <sources>
  107. <source>${generated.sources.dir}</source>
  108. </sources>
  109. </configuration>
  110. </execution>
  111. <execution>
  112. <id>add-generated-test-sources</id>
  113. <phase>generate-test-sources</phase>
  114. <goals>
  115. <goal>add-test-source</goal>
  116. </goals>
  117. <configuration>
  118. <sources>
  119. <source>${generated.testsources.dir}</source>
  120. </sources>
  121. </configuration>
  122. </execution>
  123. </executions>
  124. </plugin>
  125. <!-- OSGI bundle configuration -->
  126. <plugin>
  127. <groupId>org.apache.felix</groupId>
  128. <artifactId>maven-bundle-plugin</artifactId>
  129. <extensions>true</extensions>
  130. <configuration>
  131. <instructions>
  132. <Bundle-DocURL>https://developers.google.com/protocol-buffers/</Bundle-DocURL>
  133. <Bundle-SymbolicName>com.google.protobuf</Bundle-SymbolicName>
  134. <Export-Package>com.google.protobuf;version=${project.version}</Export-Package>
  135. </instructions>
  136. </configuration>
  137. </plugin>
  138. </plugins>
  139. </build>
  140. </project>