pom.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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.5.0-SNAPSHOT</version>
  22. <relativePath>../../hadoop-project-dist</relativePath>
  23. </parent>
  24. <artifactId>hadoop-hdfs-native-client</artifactId>
  25. <version>3.5.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/"/>
  146. <arg line="-DGENERATED_JAVAH=${project.build.directory}/native/javah"/>
  147. <arg line="-DJVM_ARCH_DATA_MODEL=${sun.arch.data.model}"/>
  148. <arg line="-DREQUIRE_VALGRIND=${require.valgrind}"/>
  149. <arg line="-DHADOOP_BUILD=1"/>
  150. <arg line="-DREQUIRE_LIBWEBHDFS=${require.libwebhdfs}"/>
  151. <arg line="-DREQUIRE_OPENSSL=${require.openssl}"/>
  152. <arg line="-DCUSTOM_OPENSSL_PREFIX=${openssl.prefix}"/>
  153. <arg line="-DCUSTOM_OPENSSL_LIB=${openssl.lib}"/>
  154. <arg line="-DCUSTOM_OPENSSL_INCLUDE=${openssl.include}"/>
  155. <arg line="-DCMAKE_PREFIX_PATH=${windows.cmake.prefix.path}"/>
  156. <arg line="-DCMAKE_TOOLCHAIN_FILE=${windows.cmake.toolchain.file}"/>
  157. <arg line="-DCMAKE_BUILD_TYPE=${windows.cmake.build.type}"/>
  158. <arg line="-DBUILD_SHARED_HDFSPP=${windows.build.hdfspp.dll}"/>
  159. <arg line="-DNO_SASL=${windows.no.sasl}"/>
  160. <arg line="-DREQUIRE_FUSE=${require.fuse}"/>
  161. <arg line="-A '${env.PLATFORM}'"/>
  162. <arg line="${native_cmake_args}"/>
  163. </exec>
  164. <exec executable="msbuild" dir="${project.build.directory}/native"
  165. failonerror="true">
  166. <arg line="ALL_BUILD.vcxproj /nologo /p:Configuration=RelWithDebInfo /p:LinkIncremental=false"/>
  167. <arg line="${native_make_args}"/>
  168. </exec>
  169. <!-- Copy for inclusion in distribution. -->
  170. <copy todir="${project.build.directory}/bin">
  171. <fileset dir="${project.build.directory}/native/bin/RelWithDebInfo"/>
  172. </copy>
  173. </target>
  174. </configuration>
  175. </execution>
  176. <execution>
  177. <id>native_tests</id>
  178. <phase>test</phase>
  179. <goals><goal>run</goal></goals>
  180. <configuration>
  181. <skip>${skipTests}</skip>
  182. <target>
  183. <property name="compile_classpath" refid="maven.compile.classpath"/>
  184. <property name="test_classpath" refid="maven.test.classpath"/>
  185. <exec executable="ctest" failonerror="true" dir="${project.build.directory}/native">
  186. <arg line="--output-on-failure"/>
  187. <arg line="${native_ctest_args}"/>
  188. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  189. <!-- HADOOP_HOME required to find winutils. -->
  190. <env key="HADOOP_HOME" value="${hadoop.common.build.dir}"/>
  191. <!-- Make sure hadoop.dll and jvm.dll are on PATH. -->
  192. <env key="PATH" value="${env.PATH};${hadoop.common.build.dir}/bin;${java.home}/jre/bin/server;${java.home}/bin/server"/>
  193. <!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
  194. <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"/>
  195. </exec>
  196. </target>
  197. </configuration>
  198. </execution>
  199. </executions>
  200. </plugin>
  201. </plugins>
  202. </build>
  203. </profile>
  204. <profile>
  205. <id>native</id>
  206. <activation>
  207. <activeByDefault>false</activeByDefault>
  208. </activation>
  209. <properties>
  210. <runningWithNative>true</runningWithNative>
  211. </properties>
  212. <build>
  213. <plugins>
  214. <plugin>
  215. <groupId>org.apache.hadoop</groupId>
  216. <artifactId>hadoop-maven-plugins</artifactId>
  217. <executions>
  218. <execution>
  219. <id>cmake-compile</id>
  220. <phase>compile</phase>
  221. <goals><goal>cmake-compile</goal></goals>
  222. <configuration>
  223. <source>${basedir}/src</source>
  224. <vars>
  225. <GENERATED_JAVAH>${project.build.directory}/native/javah</GENERATED_JAVAH>
  226. <JVM_ARCH_DATA_MODEL>${sun.arch.data.model}</JVM_ARCH_DATA_MODEL>
  227. <REQUIRE_FUSE>${require.fuse}</REQUIRE_FUSE>
  228. <REQUIRE_VALGRIND>${require.valgrind}</REQUIRE_VALGRIND>
  229. <HADOOP_BUILD>1</HADOOP_BUILD>
  230. <REQUIRE_LIBWEBHDFS>${require.libwebhdfs}</REQUIRE_LIBWEBHDFS>
  231. <REQUIRE_OPENSSL>${require.openssl}</REQUIRE_OPENSSL>
  232. <CUSTOM_OPENSSL_PREFIX>${openssl.prefix}</CUSTOM_OPENSSL_PREFIX>
  233. <CUSTOM_OPENSSL_LIB>${openssl.lib}</CUSTOM_OPENSSL_LIB>
  234. <CUSTOM_OPENSSL_INCLUDE>${openssl.include}</CUSTOM_OPENSSL_INCLUDE>
  235. </vars>
  236. <output>${project.build.directory}</output>
  237. </configuration>
  238. </execution>
  239. </executions>
  240. </plugin>
  241. <plugin>
  242. <groupId>org.apache.maven.plugins</groupId>
  243. <artifactId>maven-antrun-plugin</artifactId>
  244. <executions>
  245. <execution>
  246. <id>native_tests</id>
  247. <phase>test</phase>
  248. <goals><goal>run</goal></goals>
  249. <configuration>
  250. <skip>${skipTests}</skip>
  251. <target>
  252. <property name="compile_classpath" refid="maven.compile.classpath"/>
  253. <property name="test_classpath" refid="maven.test.classpath"/>
  254. <exec executable="ctest" failonerror="true" dir="${project.build.directory}/">
  255. <arg line="--output-on-failure"/>
  256. <arg line="${native_ctest_args}"/>
  257. <env key="LIBHDFS_OPTS" value="${env.LIBHDFS_OPTS} -Xcheck:jni"/>
  258. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  259. <!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
  260. <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"/>
  261. <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"/>
  262. </exec>
  263. </target>
  264. </configuration>
  265. </execution>
  266. </executions>
  267. </plugin>
  268. </plugins>
  269. </build>
  270. </profile>
  271. <profile>
  272. <id>native-clang</id>
  273. <activation>
  274. <activeByDefault>false</activeByDefault>
  275. </activation>
  276. <properties>
  277. <runningWithNative>true</runningWithNative>
  278. </properties>
  279. <build>
  280. <plugins>
  281. <plugin>
  282. <groupId>org.apache.hadoop</groupId>
  283. <artifactId>hadoop-maven-plugins</artifactId>
  284. <executions>
  285. <execution>
  286. <id>cmake-compile-clang</id>
  287. <phase>compile</phase>
  288. <goals><goal>cmake-compile</goal></goals>
  289. <configuration>
  290. <source>${basedir}/src</source>
  291. <vars>
  292. <CMAKE_C_COMPILER>clang</CMAKE_C_COMPILER>
  293. <CMAKE_CXX_COMPILER>clang++</CMAKE_CXX_COMPILER>
  294. <GENERATED_JAVAH>${project.build.directory}/native/javah</GENERATED_JAVAH>
  295. <JVM_ARCH_DATA_MODEL>${sun.arch.data.model}</JVM_ARCH_DATA_MODEL>
  296. <REQUIRE_FUSE>${require.fuse}</REQUIRE_FUSE>
  297. <REQUIRE_VALGRIND>${require.valgrind}</REQUIRE_VALGRIND>
  298. <HADOOP_BUILD>1</HADOOP_BUILD>
  299. <REQUIRE_LIBWEBHDFS>${require.libwebhdfs}</REQUIRE_LIBWEBHDFS>
  300. <REQUIRE_OPENSSL>${require.openssl}</REQUIRE_OPENSSL>
  301. <CUSTOM_OPENSSL_PREFIX>${openssl.prefix}</CUSTOM_OPENSSL_PREFIX>
  302. <CUSTOM_OPENSSL_LIB>${openssl.lib}</CUSTOM_OPENSSL_LIB>
  303. <CUSTOM_OPENSSL_INCLUDE>${openssl.include}</CUSTOM_OPENSSL_INCLUDE>
  304. </vars>
  305. <output>${project.build.directory}/clang</output>
  306. </configuration>
  307. </execution>
  308. </executions>
  309. </plugin>
  310. <plugin>
  311. <groupId>org.apache.maven.plugins</groupId>
  312. <artifactId>maven-antrun-plugin</artifactId>
  313. <executions>
  314. <execution>
  315. <id>native_tests_clang</id>
  316. <phase>test</phase>
  317. <goals><goal>run</goal></goals>
  318. <configuration>
  319. <skip>${skipTests}</skip>
  320. <target>
  321. <property name="compile_classpath" refid="maven.compile.classpath"/>
  322. <property name="test_classpath" refid="maven.test.classpath"/>
  323. <exec executable="ctest" failonerror="true" dir="${project.build.directory}/clang">
  324. <arg line="--output-on-failure"/>
  325. <arg line="${native_ctest_args}"/>
  326. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  327. <!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
  328. <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"/>
  329. <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"/>
  330. </exec>
  331. </target>
  332. </configuration>
  333. </execution>
  334. </executions>
  335. </plugin>
  336. </plugins>
  337. </build>
  338. </profile>
  339. </profiles>
  340. </project>