pom.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  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. <plugin>
  94. <groupId>org.apache.maven.plugins</groupId>
  95. <artifactId>maven-enforcer-plugin</artifactId>
  96. <dependencies>
  97. <dependency>
  98. <groupId>de.skuzzle.enforcer</groupId>
  99. <artifactId>restrict-imports-enforcer-rule</artifactId>
  100. <version>${restrict-imports.enforcer.version}</version>
  101. </dependency>
  102. </dependencies>
  103. <executions>
  104. <execution>
  105. <id>banned-illegal-imports</id>
  106. <phase>process-sources</phase>
  107. <goals>
  108. <goal>enforce</goal>
  109. </goals>
  110. <configuration>
  111. <rules>
  112. <restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
  113. <includeTestCode>true</includeTestCode>
  114. <reason>Use hadoop-common provided VisibleForTesting rather than the one provided by Guava</reason>
  115. <bannedImports>
  116. <bannedImport>org.apache.hadoop.thirdparty.com.google.common.annotations.VisibleForTesting</bannedImport>
  117. <bannedImport>com.google.common.annotations.VisibleForTesting</bannedImport>
  118. </bannedImports>
  119. </restrictImports>
  120. </rules>
  121. </configuration>
  122. </execution>
  123. </executions>
  124. </plugin>
  125. </plugins>
  126. </build>
  127. <profiles>
  128. <profile>
  129. <id>native-win</id>
  130. <activation>
  131. <activeByDefault>false</activeByDefault>
  132. <os>
  133. <family>windows</family>
  134. </os>
  135. </activation>
  136. <properties>
  137. <runningWithNative>true</runningWithNative>
  138. </properties>
  139. <build>
  140. <plugins>
  141. <plugin>
  142. <groupId>org.apache.maven.plugins</groupId>
  143. <artifactId>maven-enforcer-plugin</artifactId>
  144. <executions>
  145. <execution>
  146. <id>enforce-os</id>
  147. <goals>
  148. <goal>enforce</goal>
  149. </goals>
  150. <configuration>
  151. <rules>
  152. <requireOS>
  153. <family>windows</family>
  154. <message>native-win build only supported on Windows</message>
  155. </requireOS>
  156. </rules>
  157. <fail>true</fail>
  158. </configuration>
  159. </execution>
  160. </executions>
  161. </plugin>
  162. <plugin>
  163. <groupId>org.apache.maven.plugins</groupId>
  164. <artifactId>maven-antrun-plugin</artifactId>
  165. <executions>
  166. <execution>
  167. <id>make</id>
  168. <phase>compile</phase>
  169. <goals>
  170. <goal>run</goal>
  171. </goals>
  172. <configuration>
  173. <target>
  174. <mkdir dir="${project.build.directory}/native"/>
  175. <exec executable="cmake" dir="${project.build.directory}/native"
  176. failonerror="true">
  177. <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}'"/>
  178. <arg line="${native_cmake_args}"/>
  179. </exec>
  180. <exec executable="msbuild" dir="${project.build.directory}/native"
  181. failonerror="true">
  182. <arg line="ALL_BUILD.vcxproj /nologo /p:Configuration=RelWithDebInfo /p:LinkIncremental=false"/>
  183. <arg line="${native_make_args}"/>
  184. </exec>
  185. <!-- Copy for inclusion in distribution. -->
  186. <copy todir="${project.build.directory}/bin">
  187. <fileset dir="${project.build.directory}/native/bin/RelWithDebInfo"/>
  188. </copy>
  189. </target>
  190. </configuration>
  191. </execution>
  192. <execution>
  193. <id>native_tests</id>
  194. <phase>test</phase>
  195. <goals><goal>run</goal></goals>
  196. <configuration>
  197. <skip>${skipTests}</skip>
  198. <target>
  199. <property name="compile_classpath" refid="maven.compile.classpath"/>
  200. <property name="test_classpath" refid="maven.test.classpath"/>
  201. <exec executable="ctest" failonerror="true" dir="${project.build.directory}/native">
  202. <arg line="--output-on-failure"/>
  203. <arg line="${native_ctest_args}"/>
  204. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  205. <!-- HADOOP_HOME required to find winutils. -->
  206. <env key="HADOOP_HOME" value="${hadoop.common.build.dir}"/>
  207. <!-- Make sure hadoop.dll and jvm.dll are on PATH. -->
  208. <env key="PATH" value="${env.PATH};${hadoop.common.build.dir}/bin;${java.home}/jre/bin/server;${java.home}/bin/server"/>
  209. <!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
  210. <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"/>
  211. </exec>
  212. </target>
  213. </configuration>
  214. </execution>
  215. </executions>
  216. </plugin>
  217. </plugins>
  218. </build>
  219. </profile>
  220. <profile>
  221. <id>native</id>
  222. <activation>
  223. <activeByDefault>false</activeByDefault>
  224. </activation>
  225. <properties>
  226. <runningWithNative>true</runningWithNative>
  227. </properties>
  228. <build>
  229. <plugins>
  230. <plugin>
  231. <groupId>org.apache.hadoop</groupId>
  232. <artifactId>hadoop-maven-plugins</artifactId>
  233. <executions>
  234. <execution>
  235. <id>cmake-compile</id>
  236. <phase>compile</phase>
  237. <goals><goal>cmake-compile</goal></goals>
  238. <configuration>
  239. <source>${basedir}/src</source>
  240. <vars>
  241. <GENERATED_JAVAH>${project.build.directory}/native/javah</GENERATED_JAVAH>
  242. <JVM_ARCH_DATA_MODEL>${sun.arch.data.model}</JVM_ARCH_DATA_MODEL>
  243. <REQUIRE_FUSE>${require.fuse}</REQUIRE_FUSE>
  244. <REQUIRE_VALGRIND>${require.valgrind}</REQUIRE_VALGRIND>
  245. <HADOOP_BUILD>1</HADOOP_BUILD>
  246. <REQUIRE_LIBWEBHDFS>${require.libwebhdfs}</REQUIRE_LIBWEBHDFS>
  247. <REQUIRE_OPENSSL>${require.openssl}</REQUIRE_OPENSSL>
  248. <CUSTOM_OPENSSL_PREFIX>${openssl.prefix}</CUSTOM_OPENSSL_PREFIX>
  249. <CUSTOM_OPENSSL_LIB>${openssl.lib}</CUSTOM_OPENSSL_LIB>
  250. <CUSTOM_OPENSSL_INCLUDE>${openssl.include}</CUSTOM_OPENSSL_INCLUDE>
  251. </vars>
  252. <output>${project.build.directory}</output>
  253. </configuration>
  254. </execution>
  255. </executions>
  256. </plugin>
  257. <plugin>
  258. <groupId>org.apache.maven.plugins</groupId>
  259. <artifactId>maven-antrun-plugin</artifactId>
  260. <executions>
  261. <execution>
  262. <id>native_tests</id>
  263. <phase>test</phase>
  264. <goals><goal>run</goal></goals>
  265. <configuration>
  266. <skip>${skipTests}</skip>
  267. <target>
  268. <property name="compile_classpath" refid="maven.compile.classpath"/>
  269. <property name="test_classpath" refid="maven.test.classpath"/>
  270. <exec executable="ctest" failonerror="true" dir="${project.build.directory}/">
  271. <arg line="--output-on-failure"/>
  272. <arg line="${native_ctest_args}"/>
  273. <env key="LIBHDFS_OPTS" value="${env.LIBHDFS_OPTS} -Xcheck:jni"/>
  274. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  275. <!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
  276. <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"/>
  277. <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"/>
  278. </exec>
  279. </target>
  280. </configuration>
  281. </execution>
  282. </executions>
  283. </plugin>
  284. </plugins>
  285. </build>
  286. </profile>
  287. <profile>
  288. <id>native-clang</id>
  289. <activation>
  290. <activeByDefault>false</activeByDefault>
  291. </activation>
  292. <properties>
  293. <runningWithNative>true</runningWithNative>
  294. </properties>
  295. <build>
  296. <plugins>
  297. <plugin>
  298. <groupId>org.apache.hadoop</groupId>
  299. <artifactId>hadoop-maven-plugins</artifactId>
  300. <executions>
  301. <execution>
  302. <id>cmake-compile-clang</id>
  303. <phase>compile</phase>
  304. <goals><goal>cmake-compile</goal></goals>
  305. <configuration>
  306. <source>${basedir}/src</source>
  307. <vars>
  308. <CMAKE_C_COMPILER>clang</CMAKE_C_COMPILER>
  309. <CMAKE_CXX_COMPILER>clang++</CMAKE_CXX_COMPILER>
  310. <GENERATED_JAVAH>${project.build.directory}/native/javah</GENERATED_JAVAH>
  311. <JVM_ARCH_DATA_MODEL>${sun.arch.data.model}</JVM_ARCH_DATA_MODEL>
  312. <REQUIRE_FUSE>${require.fuse}</REQUIRE_FUSE>
  313. <REQUIRE_VALGRIND>${require.valgrind}</REQUIRE_VALGRIND>
  314. <HADOOP_BUILD>1</HADOOP_BUILD>
  315. <REQUIRE_LIBWEBHDFS>${require.libwebhdfs}</REQUIRE_LIBWEBHDFS>
  316. <REQUIRE_OPENSSL>${require.openssl}</REQUIRE_OPENSSL>
  317. <CUSTOM_OPENSSL_PREFIX>${openssl.prefix}</CUSTOM_OPENSSL_PREFIX>
  318. <CUSTOM_OPENSSL_LIB>${openssl.lib}</CUSTOM_OPENSSL_LIB>
  319. <CUSTOM_OPENSSL_INCLUDE>${openssl.include}</CUSTOM_OPENSSL_INCLUDE>
  320. </vars>
  321. <output>${project.build.directory}/clang</output>
  322. </configuration>
  323. </execution>
  324. </executions>
  325. </plugin>
  326. <plugin>
  327. <groupId>org.apache.maven.plugins</groupId>
  328. <artifactId>maven-antrun-plugin</artifactId>
  329. <executions>
  330. <execution>
  331. <id>native_tests_clang</id>
  332. <phase>test</phase>
  333. <goals><goal>run</goal></goals>
  334. <configuration>
  335. <skip>${skipTests}</skip>
  336. <target>
  337. <property name="compile_classpath" refid="maven.compile.classpath"/>
  338. <property name="test_classpath" refid="maven.test.classpath"/>
  339. <exec executable="ctest" failonerror="true" dir="${project.build.directory}/clang">
  340. <arg line="--output-on-failure"/>
  341. <arg line="${native_ctest_args}"/>
  342. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  343. <!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
  344. <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"/>
  345. <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"/>
  346. </exec>
  347. </target>
  348. </configuration>
  349. </execution>
  350. </executions>
  351. </plugin>
  352. </plugins>
  353. </build>
  354. </profile>
  355. </profiles>
  356. </project>