pom.xml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License. See accompanying LICENSE file.
  12. -->
  13. <project xmlns="http://maven.apache.org/POM/4.0.0"
  14. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  15. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  16. <parent>
  17. <artifactId>hadoop-yarn</artifactId>
  18. <groupId>org.apache.hadoop</groupId>
  19. <version>3.3.0-SNAPSHOT</version>
  20. </parent>
  21. <modelVersion>4.0.0</modelVersion>
  22. <artifactId>hadoop-yarn-csi</artifactId>
  23. <name>Apache Hadoop YARN CSI</name>
  24. <packaging>jar</packaging>
  25. <properties>
  26. <protobuf.version>3.6.1</protobuf.version>
  27. <guava.version>20.0</guava.version>
  28. <grpc.version>1.15.1</grpc.version>
  29. <netty-all.version>4.1.27.Final</netty-all.version>
  30. <os-maven-plugin.version>1.5.0.Final</os-maven-plugin.version>
  31. </properties>
  32. <dependencies>
  33. <dependency>
  34. <groupId>com.google.guava</groupId>
  35. <artifactId>guava</artifactId>
  36. <version>${guava.version}</version>
  37. </dependency>
  38. <dependency>
  39. <groupId>com.google.protobuf</groupId>
  40. <artifactId>protobuf-java</artifactId>
  41. <version>${protobuf.version}</version>
  42. </dependency>
  43. <dependency>
  44. <groupId>io.netty</groupId>
  45. <artifactId>netty-all</artifactId>
  46. <version>${netty-all.version}</version>
  47. </dependency>
  48. <dependency>
  49. <groupId>io.grpc</groupId>
  50. <artifactId>grpc-core</artifactId>
  51. <version>${grpc.version}</version>
  52. </dependency>
  53. <dependency>
  54. <groupId>io.grpc</groupId>
  55. <artifactId>grpc-protobuf</artifactId>
  56. <version>${grpc.version}</version>
  57. </dependency>
  58. <dependency>
  59. <groupId>io.grpc</groupId>
  60. <artifactId>grpc-stub</artifactId>
  61. <version>${grpc.version}</version>
  62. </dependency>
  63. <dependency>
  64. <groupId>io.grpc</groupId>
  65. <artifactId>grpc-netty</artifactId>
  66. <version>${grpc.version}</version>
  67. </dependency>
  68. <dependency>
  69. <groupId>commons-logging</groupId>
  70. <artifactId>commons-logging</artifactId>
  71. </dependency>
  72. <dependency>
  73. <groupId>junit</groupId>
  74. <artifactId>junit</artifactId>
  75. </dependency>
  76. <dependency>
  77. <groupId>org.apache.hadoop</groupId>
  78. <artifactId>hadoop-common</artifactId>
  79. <type>test-jar</type>
  80. <scope>test</scope>
  81. </dependency>
  82. <dependency>
  83. <groupId>org.apache.hadoop</groupId>
  84. <artifactId>hadoop-common</artifactId>
  85. </dependency>
  86. <dependency>
  87. <groupId>org.apache.hadoop</groupId>
  88. <artifactId>hadoop-yarn-common</artifactId>
  89. </dependency>
  90. <dependency>
  91. <groupId>org.apache.hadoop</groupId>
  92. <artifactId>hadoop-yarn-api</artifactId>
  93. </dependency>
  94. <dependency>
  95. <groupId>javax.annotation</groupId>
  96. <artifactId>javax.annotation-api</artifactId>
  97. <scope>compile</scope>
  98. </dependency>
  99. </dependencies>
  100. <build>
  101. <extensions>
  102. <extension>
  103. <groupId>kr.motd.maven</groupId>
  104. <artifactId>os-maven-plugin</artifactId>
  105. <version>${os-maven-plugin.version}</version>
  106. </extension>
  107. </extensions>
  108. <plugins>
  109. <plugin>
  110. <groupId>org.apache.maven.plugins</groupId>
  111. <artifactId>maven-dependency-plugin</artifactId>
  112. </plugin>
  113. <plugin>
  114. <groupId>org.apache.maven.plugins</groupId>
  115. <artifactId>maven-compiler-plugin</artifactId>
  116. </plugin>
  117. <plugin>
  118. <artifactId>maven-clean-plugin</artifactId>
  119. <configuration>
  120. <filesets>
  121. <fileset>
  122. <directory>target/</directory>
  123. </fileset>
  124. </filesets>
  125. </configuration>
  126. </plugin>
  127. <plugin>
  128. <groupId>org.xolstice.maven.plugins</groupId>
  129. <artifactId>protobuf-maven-plugin</artifactId>
  130. <version>${protobuf-maven-plugin.version}</version>
  131. <configuration>
  132. <protocArtifact>com.google.protobuf:protoc:3.6.1:exe:${os.detected.classifier}</protocArtifact>
  133. <pluginId>grpc-java</pluginId>
  134. <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.15.1:exe:${os.detected.classifier}</pluginArtifact>
  135. </configuration>
  136. <executions>
  137. <execution>
  138. <goals>
  139. <goal>compile</goal>
  140. <goal>compile-custom</goal>
  141. </goals>
  142. </execution>
  143. </executions>
  144. </plugin>
  145. <plugin>
  146. <groupId>org.apache.maven.plugins</groupId>
  147. <artifactId>maven-shade-plugin</artifactId>
  148. <version>${maven-shade-plugin.version}</version>
  149. <configuration>
  150. <createDependencyReducedPom>false</createDependencyReducedPom>
  151. </configuration>
  152. <executions>
  153. <execution>
  154. <phase>package</phase>
  155. <goals>
  156. <goal>shade</goal>
  157. </goals>
  158. <configuration>
  159. <relocations>
  160. <relocation>
  161. <pattern>io.grpc</pattern>
  162. <shadedPattern>csi.io.grpc</shadedPattern>
  163. </relocation>
  164. <relocation>
  165. <!-- this includes protobuf-java and guava libraries -->
  166. <pattern>com.google</pattern>
  167. <shadedPattern>csi.com.google</shadedPattern>
  168. </relocation>
  169. <relocation>
  170. <pattern>io.netty</pattern>
  171. <shadedPattern>csi.io.netty</shadedPattern>
  172. </relocation>
  173. </relocations>
  174. <transformers>
  175. <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer" />
  176. </transformers>
  177. </configuration>
  178. </execution>
  179. </executions>
  180. </plugin>
  181. <plugin>
  182. <!-- We need to rename the native library file in order to let shaded classes to load them -->
  183. <groupId>org.apache.maven.plugins</groupId>
  184. <artifactId>maven-antrun-plugin</artifactId>
  185. <executions>
  186. <execution>
  187. <id>unpack</id>
  188. <phase>package</phase>
  189. <configuration>
  190. <target>
  191. <echo message="Unpack hadoop-yarn-csi jar file"/>
  192. <unzip src="${project.build.directory}/${project.artifactId}-${project.version}.jar"
  193. dest="${project.build.directory}/unpacked/"/>
  194. <echo message="Append the shaded prefix to netty's native file in META-INF"/>
  195. <move file="${project.build.directory}/unpacked/META-INF/native/libnetty_transport_native_epoll_x86_64.so"
  196. tofile="${project.build.directory}/unpacked/META-INF/native/libcsi_netty_transport_native_epoll_x86_64.so" />
  197. <echo message="Re-pack the jar"/>
  198. <jar destfile="${project.build.directory}/${project.artifactId}-${project.version}.jar"
  199. basedir="${project.build.directory}/unpacked"/>
  200. </target>
  201. </configuration>
  202. <goals>
  203. <goal>run</goal>
  204. </goals>
  205. </execution>
  206. </executions>
  207. </plugin>
  208. <plugin>
  209. <groupId>org.apache.rat</groupId>
  210. <artifactId>apache-rat-plugin</artifactId>
  211. <configuration>
  212. <excludes>
  213. <exclude>target/generated-sources/**</exclude>
  214. <exclude>target/surefire-reports/**</exclude>
  215. <exclude>target/protoc-dependencies/**</exclude>
  216. </excludes>
  217. </configuration>
  218. </plugin>
  219. <plugin>
  220. <groupId>org.apache.maven.plugins</groupId>
  221. <artifactId>maven-javadoc-plugin</artifactId>
  222. <configuration>
  223. <excludePackageNames>csi.v0</excludePackageNames>
  224. </configuration>
  225. </plugin>
  226. </plugins>
  227. </build>
  228. </project>