pom.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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.5.2</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. </dependencies>
  35. <build>
  36. <!-- Include core protos in the bundle as resources -->
  37. <resources>
  38. <resource>
  39. <directory>${protobuf.source.dir}</directory>
  40. <includes>
  41. <include>google/protobuf/any.proto</include>
  42. <include>google/protobuf/api.proto</include>
  43. <include>google/protobuf/descriptor.proto</include>
  44. <include>google/protobuf/duration.proto</include>
  45. <include>google/protobuf/empty.proto</include>
  46. <include>google/protobuf/field_mask.proto</include>
  47. <include>google/protobuf/source_context.proto</include>
  48. <include>google/protobuf/struct.proto</include>
  49. <include>google/protobuf/timestamp.proto</include>
  50. <include>google/protobuf/type.proto</include>
  51. <include>google/protobuf/wrappers.proto</include>
  52. <include>google/protobuf/compiler/plugin.proto</include>
  53. </includes>
  54. </resource>
  55. </resources>
  56. <plugins>
  57. <!-- Use Antrun plugin to generate sources with protoc -->
  58. <plugin>
  59. <artifactId>maven-antrun-plugin</artifactId>
  60. <executions>
  61. <!-- Generate core protos -->
  62. <execution>
  63. <id>generate-sources</id>
  64. <phase>generate-sources</phase>
  65. <configuration>
  66. <target>
  67. <ant antfile="generate-sources-build.xml"/>
  68. </target>
  69. </configuration>
  70. <goals>
  71. <goal>run</goal>
  72. </goals>
  73. </execution>
  74. <!-- Generate the test protos -->
  75. <execution>
  76. <id>generate-test-sources</id>
  77. <phase>generate-test-sources</phase>
  78. <configuration>
  79. <target>
  80. <ant antfile="generate-test-sources-build.xml"/>
  81. </target>
  82. </configuration>
  83. <goals>
  84. <goal>run</goal>
  85. </goals>
  86. </execution>
  87. </executions>
  88. </plugin>
  89. <!-- Add the generated sources to the build -->
  90. <plugin>
  91. <groupId>org.codehaus.mojo</groupId>
  92. <artifactId>build-helper-maven-plugin</artifactId>
  93. <executions>
  94. <execution>
  95. <id>add-generated-sources</id>
  96. <phase>generate-sources</phase>
  97. <goals>
  98. <goal>add-source</goal>
  99. </goals>
  100. <configuration>
  101. <sources>
  102. <source>${generated.sources.dir}</source>
  103. </sources>
  104. </configuration>
  105. </execution>
  106. <execution>
  107. <id>add-generated-test-sources</id>
  108. <phase>generate-test-sources</phase>
  109. <goals>
  110. <goal>add-test-source</goal>
  111. </goals>
  112. <configuration>
  113. <sources>
  114. <source>${generated.testsources.dir}</source>
  115. </sources>
  116. </configuration>
  117. </execution>
  118. </executions>
  119. </plugin>
  120. <!-- OSGI bundle configuration -->
  121. <plugin>
  122. <groupId>org.apache.felix</groupId>
  123. <artifactId>maven-bundle-plugin</artifactId>
  124. <extensions>true</extensions>
  125. <configuration>
  126. <instructions>
  127. <Bundle-DocURL>https://developers.google.com/protocol-buffers/</Bundle-DocURL>
  128. <Bundle-SymbolicName>com.google.protobuf</Bundle-SymbolicName>
  129. <Export-Package>com.google.protobuf;version=${project.version}</Export-Package>
  130. </instructions>
  131. </configuration>
  132. </plugin>
  133. </plugins>
  134. </build>
  135. </project>