pom.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  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-inline</artifactId>
  69. <scope>test</scope>
  70. </dependency>
  71. <dependency>
  72. <groupId>junit</groupId>
  73. <artifactId>junit</artifactId>
  74. <scope>test</scope>
  75. </dependency>
  76. <dependency>
  77. <groupId>org.junit.jupiter</groupId>
  78. <artifactId>junit-jupiter-api</artifactId>
  79. <scope>test</scope>
  80. </dependency>
  81. <dependency>
  82. <groupId>org.junit.jupiter</groupId>
  83. <artifactId>junit-jupiter-engine</artifactId>
  84. <scope>test</scope>
  85. </dependency>
  86. <dependency>
  87. <groupId>org.junit.jupiter</groupId>
  88. <artifactId>junit-jupiter-params</artifactId>
  89. <scope>test</scope>
  90. </dependency>
  91. <dependency>
  92. <groupId>org.junit.platform</groupId>
  93. <artifactId>junit-platform-launcher</artifactId>
  94. <scope>test</scope>
  95. </dependency>
  96. <dependency>
  97. <groupId>org.junit.vintage</groupId>
  98. <artifactId>junit-vintage-engine</artifactId>
  99. <scope>test</scope>
  100. </dependency>
  101. </dependencies>
  102. <build>
  103. <plugins>
  104. <plugin>
  105. <groupId>org.apache.rat</groupId>
  106. <artifactId>apache-rat-plugin</artifactId>
  107. <configuration>
  108. <excludes>
  109. <exclude>src/main/native/*</exclude>
  110. <exclude>src/main/native/config/*</exclude>
  111. <exclude>src/main/native/m4/*</exclude>
  112. <exclude>src/main/native/fuse-dfs/util/tree.h</exclude>
  113. <exclude>src/main/native/libhdfspp/third_party/**</exclude>
  114. <exclude>src/contrib/**</exclude>
  115. </excludes>
  116. </configuration>
  117. </plugin>
  118. </plugins>
  119. </build>
  120. <profiles>
  121. <profile>
  122. <id>native-win</id>
  123. <activation>
  124. <activeByDefault>false</activeByDefault>
  125. <os>
  126. <family>windows</family>
  127. </os>
  128. </activation>
  129. <properties>
  130. <runningWithNative>true</runningWithNative>
  131. </properties>
  132. <build>
  133. <plugins>
  134. <plugin>
  135. <groupId>org.apache.maven.plugins</groupId>
  136. <artifactId>maven-enforcer-plugin</artifactId>
  137. <executions>
  138. <execution>
  139. <id>enforce-os</id>
  140. <goals>
  141. <goal>enforce</goal>
  142. </goals>
  143. <configuration>
  144. <rules>
  145. <requireOS>
  146. <family>windows</family>
  147. <message>native-win build only supported on Windows</message>
  148. </requireOS>
  149. </rules>
  150. <fail>true</fail>
  151. </configuration>
  152. </execution>
  153. </executions>
  154. </plugin>
  155. <plugin>
  156. <groupId>org.apache.maven.plugins</groupId>
  157. <artifactId>maven-antrun-plugin</artifactId>
  158. <executions>
  159. <execution>
  160. <id>make</id>
  161. <phase>compile</phase>
  162. <goals>
  163. <goal>run</goal>
  164. </goals>
  165. <configuration>
  166. <target>
  167. <mkdir dir="${project.build.directory}/native"/>
  168. <exec executable="cmake" dir="${project.build.directory}/native"
  169. failonerror="true">
  170. <arg line="${basedir}/src/"/>
  171. <arg line="-DGENERATED_JAVAH=${project.build.directory}/native/javah"/>
  172. <arg line="-DJVM_ARCH_DATA_MODEL=${sun.arch.data.model}"/>
  173. <arg line="-DREQUIRE_VALGRIND=${require.valgrind}"/>
  174. <arg line="-DHADOOP_BUILD=1"/>
  175. <arg line="-DREQUIRE_LIBWEBHDFS=${require.libwebhdfs}"/>
  176. <arg line="-DREQUIRE_OPENSSL=${require.openssl}"/>
  177. <arg line="-DCUSTOM_OPENSSL_PREFIX=${openssl.prefix}"/>
  178. <arg line="-DCUSTOM_OPENSSL_LIB=${openssl.lib}"/>
  179. <arg line="-DCUSTOM_OPENSSL_INCLUDE=${openssl.include}"/>
  180. <arg line="-DCMAKE_PREFIX_PATH=${windows.cmake.prefix.path}"/>
  181. <arg line="-DCMAKE_TOOLCHAIN_FILE=${windows.cmake.toolchain.file}"/>
  182. <arg line="-DCMAKE_BUILD_TYPE=${windows.cmake.build.type}"/>
  183. <arg line="-DBUILD_SHARED_HDFSPP=${windows.build.hdfspp.dll}"/>
  184. <arg line="-DNO_SASL=${windows.no.sasl}"/>
  185. <arg line="-DREQUIRE_FUSE=${require.fuse}"/>
  186. <arg line="-A '${env.PLATFORM}'"/>
  187. <arg line="${native_cmake_args}"/>
  188. </exec>
  189. <exec executable="msbuild" dir="${project.build.directory}/native"
  190. failonerror="true">
  191. <arg line="ALL_BUILD.vcxproj /nologo /p:Configuration=RelWithDebInfo /p:LinkIncremental=false"/>
  192. <arg line="${native_make_args}"/>
  193. </exec>
  194. <!-- Copy for inclusion in distribution. -->
  195. <copy todir="${project.build.directory}/bin">
  196. <fileset dir="${project.build.directory}/native/bin/RelWithDebInfo"/>
  197. </copy>
  198. </target>
  199. </configuration>
  200. </execution>
  201. <execution>
  202. <id>native_tests</id>
  203. <phase>test</phase>
  204. <goals><goal>run</goal></goals>
  205. <configuration>
  206. <skip>${skipTests}</skip>
  207. <target>
  208. <property name="compile_classpath" refid="maven.compile.classpath"/>
  209. <property name="test_classpath" refid="maven.test.classpath"/>
  210. <exec executable="ctest" failonerror="true" dir="${project.build.directory}/native">
  211. <arg line="--output-on-failure"/>
  212. <arg line="${native_ctest_args}"/>
  213. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  214. <!-- HADOOP_HOME required to find winutils. -->
  215. <env key="HADOOP_HOME" value="${hadoop.common.build.dir}"/>
  216. <!-- Make sure hadoop.dll and jvm.dll are on PATH. -->
  217. <env key="PATH" value="${env.PATH};${hadoop.common.build.dir}/bin;${java.home}/jre/bin/server;${java.home}/bin/server"/>
  218. <!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
  219. <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"/>
  220. </exec>
  221. </target>
  222. </configuration>
  223. </execution>
  224. </executions>
  225. </plugin>
  226. </plugins>
  227. </build>
  228. </profile>
  229. <profile>
  230. <id>native</id>
  231. <activation>
  232. <activeByDefault>false</activeByDefault>
  233. </activation>
  234. <properties>
  235. <runningWithNative>true</runningWithNative>
  236. </properties>
  237. <build>
  238. <plugins>
  239. <plugin>
  240. <groupId>org.apache.hadoop</groupId>
  241. <artifactId>hadoop-maven-plugins</artifactId>
  242. <executions>
  243. <execution>
  244. <id>cmake-compile</id>
  245. <phase>compile</phase>
  246. <goals><goal>cmake-compile</goal></goals>
  247. <configuration>
  248. <source>${basedir}/src</source>
  249. <vars>
  250. <GENERATED_JAVAH>${project.build.directory}/native/javah</GENERATED_JAVAH>
  251. <JVM_ARCH_DATA_MODEL>${sun.arch.data.model}</JVM_ARCH_DATA_MODEL>
  252. <REQUIRE_FUSE>${require.fuse}</REQUIRE_FUSE>
  253. <REQUIRE_VALGRIND>${require.valgrind}</REQUIRE_VALGRIND>
  254. <HADOOP_BUILD>1</HADOOP_BUILD>
  255. <REQUIRE_LIBWEBHDFS>${require.libwebhdfs}</REQUIRE_LIBWEBHDFS>
  256. <REQUIRE_OPENSSL>${require.openssl}</REQUIRE_OPENSSL>
  257. <CUSTOM_OPENSSL_PREFIX>${openssl.prefix}</CUSTOM_OPENSSL_PREFIX>
  258. <CUSTOM_OPENSSL_LIB>${openssl.lib}</CUSTOM_OPENSSL_LIB>
  259. <CUSTOM_OPENSSL_INCLUDE>${openssl.include}</CUSTOM_OPENSSL_INCLUDE>
  260. </vars>
  261. <output>${project.build.directory}</output>
  262. </configuration>
  263. </execution>
  264. </executions>
  265. </plugin>
  266. <plugin>
  267. <groupId>org.apache.maven.plugins</groupId>
  268. <artifactId>maven-antrun-plugin</artifactId>
  269. <executions>
  270. <execution>
  271. <id>native_tests</id>
  272. <phase>test</phase>
  273. <goals><goal>run</goal></goals>
  274. <configuration>
  275. <skip>${skipTests}</skip>
  276. <target>
  277. <property name="compile_classpath" refid="maven.compile.classpath"/>
  278. <property name="test_classpath" refid="maven.test.classpath"/>
  279. <exec executable="ctest" failonerror="true" dir="${project.build.directory}/">
  280. <arg line="--output-on-failure"/>
  281. <arg line="${native_ctest_args}"/>
  282. <env key="LIBHDFS_OPTS" value="${env.LIBHDFS_OPTS} -Xcheck:jni"/>
  283. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  284. <!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
  285. <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"/>
  286. <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"/>
  287. </exec>
  288. </target>
  289. </configuration>
  290. </execution>
  291. </executions>
  292. </plugin>
  293. </plugins>
  294. </build>
  295. </profile>
  296. <profile>
  297. <id>native-clang</id>
  298. <activation>
  299. <activeByDefault>false</activeByDefault>
  300. </activation>
  301. <properties>
  302. <runningWithNative>true</runningWithNative>
  303. </properties>
  304. <build>
  305. <plugins>
  306. <plugin>
  307. <groupId>org.apache.hadoop</groupId>
  308. <artifactId>hadoop-maven-plugins</artifactId>
  309. <executions>
  310. <execution>
  311. <id>cmake-compile-clang</id>
  312. <phase>compile</phase>
  313. <goals><goal>cmake-compile</goal></goals>
  314. <configuration>
  315. <source>${basedir}/src</source>
  316. <vars>
  317. <CMAKE_C_COMPILER>clang</CMAKE_C_COMPILER>
  318. <CMAKE_CXX_COMPILER>clang++</CMAKE_CXX_COMPILER>
  319. <GENERATED_JAVAH>${project.build.directory}/native/javah</GENERATED_JAVAH>
  320. <JVM_ARCH_DATA_MODEL>${sun.arch.data.model}</JVM_ARCH_DATA_MODEL>
  321. <REQUIRE_FUSE>${require.fuse}</REQUIRE_FUSE>
  322. <REQUIRE_VALGRIND>${require.valgrind}</REQUIRE_VALGRIND>
  323. <HADOOP_BUILD>1</HADOOP_BUILD>
  324. <REQUIRE_LIBWEBHDFS>${require.libwebhdfs}</REQUIRE_LIBWEBHDFS>
  325. <REQUIRE_OPENSSL>${require.openssl}</REQUIRE_OPENSSL>
  326. <CUSTOM_OPENSSL_PREFIX>${openssl.prefix}</CUSTOM_OPENSSL_PREFIX>
  327. <CUSTOM_OPENSSL_LIB>${openssl.lib}</CUSTOM_OPENSSL_LIB>
  328. <CUSTOM_OPENSSL_INCLUDE>${openssl.include}</CUSTOM_OPENSSL_INCLUDE>
  329. </vars>
  330. <output>${project.build.directory}/clang</output>
  331. </configuration>
  332. </execution>
  333. </executions>
  334. </plugin>
  335. <plugin>
  336. <groupId>org.apache.maven.plugins</groupId>
  337. <artifactId>maven-antrun-plugin</artifactId>
  338. <executions>
  339. <execution>
  340. <id>native_tests_clang</id>
  341. <phase>test</phase>
  342. <goals><goal>run</goal></goals>
  343. <configuration>
  344. <skip>${skipTests}</skip>
  345. <target>
  346. <property name="compile_classpath" refid="maven.compile.classpath"/>
  347. <property name="test_classpath" refid="maven.test.classpath"/>
  348. <exec executable="ctest" failonerror="true" dir="${project.build.directory}/clang">
  349. <arg line="--output-on-failure"/>
  350. <arg line="${native_ctest_args}"/>
  351. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  352. <!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
  353. <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"/>
  354. <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"/>
  355. </exec>
  356. </target>
  357. </configuration>
  358. </execution>
  359. </executions>
  360. </plugin>
  361. </plugins>
  362. </build>
  363. </profile>
  364. </profiles>
  365. </project>