pom.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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.1.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. </dependency>
  23. <dependency>
  24. <groupId>org.easymock</groupId>
  25. <artifactId>easymock</artifactId>
  26. </dependency>
  27. <dependency>
  28. <groupId>org.easymock</groupId>
  29. <artifactId>easymockclassextension</artifactId>
  30. </dependency>
  31. </dependencies>
  32. <build>
  33. <!-- Include core protos in the bundle as resources -->
  34. <resources>
  35. <resource>
  36. <directory>${protobuf.source.dir}</directory>
  37. <includes>
  38. <include>google/protobuf/any.proto</include>
  39. <include>google/protobuf/api.proto</include>
  40. <include>google/protobuf/descriptor.proto</include>
  41. <include>google/protobuf/duration.proto</include>
  42. <include>google/protobuf/empty.proto</include>
  43. <include>google/protobuf/field_mask.proto</include>
  44. <include>google/protobuf/source_context.proto</include>
  45. <include>google/protobuf/struct.proto</include>
  46. <include>google/protobuf/timestamp.proto</include>
  47. <include>google/protobuf/type.proto</include>
  48. <include>google/protobuf/wrappers.proto</include>
  49. <include>google/protobuf/compiler/plugin.proto</include>
  50. </includes>
  51. </resource>
  52. </resources>
  53. <plugins>
  54. <!-- Use Antrun plugin to generate sources with protoc -->
  55. <plugin>
  56. <artifactId>maven-antrun-plugin</artifactId>
  57. <executions>
  58. <!-- Generate core protos -->
  59. <execution>
  60. <id>generate-sources</id>
  61. <phase>generate-sources</phase>
  62. <configuration>
  63. <target>
  64. <ant antfile="generate-sources-build.xml"/>
  65. </target>
  66. </configuration>
  67. <goals>
  68. <goal>run</goal>
  69. </goals>
  70. </execution>
  71. <!-- Generate the test protos -->
  72. <execution>
  73. <id>generate-test-sources</id>
  74. <phase>generate-test-sources</phase>
  75. <configuration>
  76. <target>
  77. <ant antfile="generate-test-sources-build.xml"/>
  78. </target>
  79. </configuration>
  80. <goals>
  81. <goal>run</goal>
  82. </goals>
  83. </execution>
  84. </executions>
  85. </plugin>
  86. <!-- Add the generated sources to the build -->
  87. <plugin>
  88. <artifactId>maven-compiler-plugin</artifactId>
  89. <configuration>
  90. <generatedSourcesDirectory>${generated.sources.dir}</generatedSourcesDirectory>
  91. <generatedTestSourcesDirectory>${generated.testsources.dir}</generatedTestSourcesDirectory>
  92. </configuration>
  93. </plugin>
  94. <!-- OSGI bundle configuration -->
  95. <plugin>
  96. <groupId>org.apache.felix</groupId>
  97. <artifactId>maven-bundle-plugin</artifactId>
  98. <extensions>true</extensions>
  99. <configuration>
  100. <instructions>
  101. <Bundle-DocURL>https://developers.google.com/protocol-buffers/</Bundle-DocURL>
  102. <Bundle-SymbolicName>com.google.protobuf</Bundle-SymbolicName>
  103. <Export-Package>com.google.protobuf;version=${project.version}</Export-Package>
  104. </instructions>
  105. </configuration>
  106. </plugin>
  107. </plugins>
  108. </build>
  109. </project>