pom.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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
  16. https://maven.apache.org/xsd/maven-4.0.0.xsd">
  17. <modelVersion>4.0.0</modelVersion>
  18. <parent>
  19. <groupId>org.apache.hadoop</groupId>
  20. <artifactId>hadoop-project-dist</artifactId>
  21. <version>3.4.0-SNAPSHOT</version>
  22. <relativePath>../../hadoop-project-dist</relativePath>
  23. </parent>
  24. <artifactId>hadoop-hdfs-native-client</artifactId>
  25. <version>3.4.0-SNAPSHOT</version>
  26. <description>Apache Hadoop HDFS Native Client</description>
  27. <name>Apache Hadoop HDFS Native Client</name>
  28. <packaging>jar</packaging>
  29. <properties>
  30. <require.fuse>false</require.fuse>
  31. <require.libwebhdfs>false</require.libwebhdfs>
  32. <require.valgrind>false</require.valgrind>
  33. <native_ctest_args></native_ctest_args>
  34. <native_cmake_args></native_cmake_args>
  35. <native_make_args></native_make_args>
  36. <hadoop.component>hdfs</hadoop.component>
  37. </properties>
  38. <dependencies>
  39. <dependency>
  40. <groupId>org.apache.hadoop</groupId>
  41. <artifactId>hadoop-hdfs-client</artifactId>
  42. <scope>provided</scope>
  43. </dependency>
  44. <dependency>
  45. <groupId>org.apache.hadoop</groupId>
  46. <artifactId>hadoop-common</artifactId>
  47. <scope>test</scope>
  48. </dependency>
  49. <dependency>
  50. <groupId>org.apache.hadoop</groupId>
  51. <artifactId>hadoop-common</artifactId>
  52. <type>test-jar</type>
  53. <scope>test</scope>
  54. </dependency>
  55. <dependency>
  56. <groupId>org.apache.hadoop</groupId>
  57. <artifactId>hadoop-hdfs</artifactId>
  58. <scope>test</scope>
  59. </dependency>
  60. <dependency>
  61. <groupId>org.apache.hadoop</groupId>
  62. <artifactId>hadoop-hdfs</artifactId>
  63. <type>test-jar</type>
  64. <scope>test</scope>
  65. </dependency>
  66. <dependency>
  67. <groupId>org.mockito</groupId>
  68. <artifactId>mockito-core</artifactId>
  69. <scope>test</scope>
  70. </dependency>
  71. <dependency>
  72. <groupId>junit</groupId>
  73. <artifactId>junit</artifactId>
  74. <scope>test</scope>
  75. </dependency>
  76. </dependencies>
  77. <build>
  78. <plugins>
  79. <plugin>
  80. <groupId>org.apache.rat</groupId>
  81. <artifactId>apache-rat-plugin</artifactId>
  82. <configuration>
  83. <excludes>
  84. <exclude>src/main/native/*</exclude>
  85. <exclude>src/main/native/config/*</exclude>
  86. <exclude>src/main/native/m4/*</exclude>
  87. <exclude>src/main/native/fuse-dfs/util/tree.h</exclude>
  88. <exclude>src/main/native/libhdfspp/third_party/**</exclude>
  89. <exclude>src/contrib/**</exclude>
  90. </excludes>
  91. </configuration>
  92. </plugin>
  93. </plugins>
  94. </build>
  95. <profiles>
  96. <profile>
  97. <id>native-win</id>
  98. <activation>
  99. <activeByDefault>false</activeByDefault>
  100. <os>
  101. <family>windows</family>
  102. </os>
  103. </activation>
  104. <properties>
  105. <runningWithNative>true</runningWithNative>
  106. </properties>
  107. <build>
  108. <plugins>
  109. <plugin>
  110. <groupId>org.apache.maven.plugins</groupId>
  111. <artifactId>maven-enforcer-plugin</artifactId>
  112. <executions>
  113. <execution>
  114. <id>enforce-os</id>
  115. <goals>
  116. <goal>enforce</goal>
  117. </goals>
  118. <configuration>
  119. <rules>
  120. <requireOS>
  121. <family>windows</family>
  122. <message>native-win build only supported on Windows</message>
  123. </requireOS>
  124. </rules>
  125. <fail>true</fail>
  126. </configuration>
  127. </execution>
  128. </executions>
  129. </plugin>
  130. <plugin>
  131. <groupId>org.apache.maven.plugins</groupId>
  132. <artifactId>maven-antrun-plugin</artifactId>
  133. <executions>
  134. <execution>
  135. <id>make</id>
  136. <phase>compile</phase>
  137. <goals>
  138. <goal>run</goal>
  139. </goals>
  140. <configuration>
  141. <target>
  142. <mkdir dir="${project.build.directory}/native"/>
  143. <exec executable="cmake" dir="${project.build.directory}/native"
  144. failonerror="true">
  145. <arg line="${basedir}/src/ -DGENERATED_JAVAH=${project.build.directory}/native/javah -DJVM_ARCH_DATA_MODEL=${sun.arch.data.model} -DHADOOP_BUILD=1 -DREQUIRE_FUSE=${require.fuse} -DREQUIRE_VALGRIND=${require.valgrind} -A '${env.PLATFORM}'"/>
  146. <arg line="${native_cmake_args}"/>
  147. </exec>
  148. <exec executable="msbuild" dir="${project.build.directory}/native"
  149. failonerror="true">
  150. <arg line="ALL_BUILD.vcxproj /nologo /p:Configuration=RelWithDebInfo /p:LinkIncremental=false"/>
  151. <arg line="${native_make_args}"/>
  152. </exec>
  153. <!-- Copy for inclusion in distribution. -->
  154. <copy todir="${project.build.directory}/bin">
  155. <fileset dir="${project.build.directory}/native/bin/RelWithDebInfo"/>
  156. </copy>
  157. </target>
  158. </configuration>
  159. </execution>
  160. <execution>
  161. <id>native_tests</id>
  162. <phase>test</phase>
  163. <goals><goal>run</goal></goals>
  164. <configuration>
  165. <skip>${skipTests}</skip>
  166. <target>
  167. <property name="compile_classpath" refid="maven.compile.classpath"/>
  168. <property name="test_classpath" refid="maven.test.classpath"/>
  169. <exec executable="ctest" failonerror="true" dir="${project.build.directory}/native">
  170. <arg line="--output-on-failure"/>
  171. <arg line="${native_ctest_args}"/>
  172. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  173. <!-- HADOOP_HOME required to find winutils. -->
  174. <env key="HADOOP_HOME" value="${hadoop.common.build.dir}"/>
  175. <!-- Make sure hadoop.dll and jvm.dll are on PATH. -->
  176. <env key="PATH" value="${env.PATH};${hadoop.common.build.dir}/bin;${java.home}/jre/bin/server;${java.home}/bin/server"/>
  177. <!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
  178. <env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH}:${project.build.directory}/native/target/usr/local/lib:${hadoop.common.build.dir}/native/target/usr/local/lib"/>
  179. </exec>
  180. </target>
  181. </configuration>
  182. </execution>
  183. </executions>
  184. </plugin>
  185. </plugins>
  186. </build>
  187. </profile>
  188. <profile>
  189. <id>native</id>
  190. <activation>
  191. <activeByDefault>false</activeByDefault>
  192. </activation>
  193. <properties>
  194. <runningWithNative>true</runningWithNative>
  195. </properties>
  196. <build>
  197. <plugins>
  198. <plugin>
  199. <groupId>org.apache.hadoop</groupId>
  200. <artifactId>hadoop-maven-plugins</artifactId>
  201. <executions>
  202. <execution>
  203. <id>cmake-compile</id>
  204. <phase>compile</phase>
  205. <goals><goal>cmake-compile</goal></goals>
  206. <configuration>
  207. <source>${basedir}/src</source>
  208. <vars>
  209. <GENERATED_JAVAH>${project.build.directory}/native/javah</GENERATED_JAVAH>
  210. <JVM_ARCH_DATA_MODEL>${sun.arch.data.model}</JVM_ARCH_DATA_MODEL>
  211. <REQUIRE_FUSE>${require.fuse}</REQUIRE_FUSE>
  212. <REQUIRE_VALGRIND>${require.valgrind}</REQUIRE_VALGRIND>
  213. <HADOOP_BUILD>1</HADOOP_BUILD>
  214. <REQUIRE_LIBWEBHDFS>${require.libwebhdfs}</REQUIRE_LIBWEBHDFS>
  215. <REQUIRE_OPENSSL>${require.openssl}</REQUIRE_OPENSSL>
  216. <CUSTOM_OPENSSL_PREFIX>${openssl.prefix}</CUSTOM_OPENSSL_PREFIX>
  217. <CUSTOM_OPENSSL_LIB>${openssl.lib}</CUSTOM_OPENSSL_LIB>
  218. <CUSTOM_OPENSSL_INCLUDE>${openssl.include}</CUSTOM_OPENSSL_INCLUDE>
  219. </vars>
  220. <output>${project.build.directory}</output>
  221. </configuration>
  222. </execution>
  223. </executions>
  224. </plugin>
  225. <plugin>
  226. <groupId>org.apache.maven.plugins</groupId>
  227. <artifactId>maven-antrun-plugin</artifactId>
  228. <executions>
  229. <execution>
  230. <id>native_tests</id>
  231. <phase>test</phase>
  232. <goals><goal>run</goal></goals>
  233. <configuration>
  234. <skip>${skipTests}</skip>
  235. <target>
  236. <property name="compile_classpath" refid="maven.compile.classpath"/>
  237. <property name="test_classpath" refid="maven.test.classpath"/>
  238. <exec executable="ctest" failonerror="true" dir="${project.build.directory}/">
  239. <arg line="--output-on-failure"/>
  240. <arg line="${native_ctest_args}"/>
  241. <env key="LIBHDFS_OPTS" value="${env.LIBHDFS_OPTS} -Xcheck:jni"/>
  242. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  243. <!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
  244. <env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH}:${project.build.directory}/native/target/usr/local/lib:${hadoop.common.build.dir}/native/target/usr/local/lib"/>
  245. <env key="DYLD_LIBRARY_PATH" value="${env.DYLD_LIBRARY_PATH}:${project.build.directory}/native/target/usr/local/lib:${hadoop.common.build.dir}/native/target/usr/local/lib"/>
  246. </exec>
  247. </target>
  248. </configuration>
  249. </execution>
  250. </executions>
  251. </plugin>
  252. </plugins>
  253. </build>
  254. </profile>
  255. <profile>
  256. <id>native-clang</id>
  257. <activation>
  258. <activeByDefault>false</activeByDefault>
  259. </activation>
  260. <properties>
  261. <runningWithNative>true</runningWithNative>
  262. </properties>
  263. <build>
  264. <plugins>
  265. <plugin>
  266. <groupId>org.apache.hadoop</groupId>
  267. <artifactId>hadoop-maven-plugins</artifactId>
  268. <executions>
  269. <execution>
  270. <id>cmake-compile-clang</id>
  271. <phase>compile</phase>
  272. <goals><goal>cmake-compile</goal></goals>
  273. <configuration>
  274. <source>${basedir}/src</source>
  275. <vars>
  276. <CMAKE_C_COMPILER>clang</CMAKE_C_COMPILER>
  277. <CMAKE_CXX_COMPILER>clang++</CMAKE_CXX_COMPILER>
  278. <GENERATED_JAVAH>${project.build.directory}/native/javah</GENERATED_JAVAH>
  279. <JVM_ARCH_DATA_MODEL>${sun.arch.data.model}</JVM_ARCH_DATA_MODEL>
  280. <REQUIRE_FUSE>${require.fuse}</REQUIRE_FUSE>
  281. <REQUIRE_VALGRIND>${require.valgrind}</REQUIRE_VALGRIND>
  282. <HADOOP_BUILD>1</HADOOP_BUILD>
  283. <REQUIRE_LIBWEBHDFS>${require.libwebhdfs}</REQUIRE_LIBWEBHDFS>
  284. <REQUIRE_OPENSSL>${require.openssl}</REQUIRE_OPENSSL>
  285. <CUSTOM_OPENSSL_PREFIX>${openssl.prefix}</CUSTOM_OPENSSL_PREFIX>
  286. <CUSTOM_OPENSSL_LIB>${openssl.lib}</CUSTOM_OPENSSL_LIB>
  287. <CUSTOM_OPENSSL_INCLUDE>${openssl.include}</CUSTOM_OPENSSL_INCLUDE>
  288. </vars>
  289. <output>${project.build.directory}/clang</output>
  290. </configuration>
  291. </execution>
  292. </executions>
  293. </plugin>
  294. <plugin>
  295. <groupId>org.apache.maven.plugins</groupId>
  296. <artifactId>maven-antrun-plugin</artifactId>
  297. <executions>
  298. <execution>
  299. <id>native_tests_clang</id>
  300. <phase>test</phase>
  301. <goals><goal>run</goal></goals>
  302. <configuration>
  303. <skip>${skipTests}</skip>
  304. <target>
  305. <property name="compile_classpath" refid="maven.compile.classpath"/>
  306. <property name="test_classpath" refid="maven.test.classpath"/>
  307. <exec executable="ctest" failonerror="true" dir="${project.build.directory}/clang">
  308. <arg line="--output-on-failure"/>
  309. <arg line="${native_ctest_args}"/>
  310. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  311. <!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
  312. <env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH}:${project.build.directory}/clang/target/usr/local/lib:${hadoop.common.build.dir}/native/target/usr/local/lib"/>
  313. <env key="DYLD_LIBRARY_PATH" value="${env.DYLD_LIBRARY_PATH}:${project.build.directory}/clang/target/usr/local/lib:${hadoop.common.build.dir}/native/target/usr/local/lib"/>
  314. </exec>
  315. </target>
  316. </configuration>
  317. </execution>
  318. </executions>
  319. </plugin>
  320. </plugins>
  321. </build>
  322. </profile>
  323. </profiles>
  324. </project>