pom.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  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. http://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.0.0-SNAPSHOT</version>
  22. <relativePath>../../hadoop-project-dist</relativePath>
  23. </parent>
  24. <groupId>org.apache.hadoop</groupId>
  25. <artifactId>hadoop-hdfs</artifactId>
  26. <version>3.0.0-SNAPSHOT</version>
  27. <description>Apache Hadoop HDFS</description>
  28. <name>Apache Hadoop HDFS</name>
  29. <packaging>jar</packaging>
  30. <properties>
  31. <hadoop.component>hdfs</hadoop.component>
  32. <kdc.resource.dir>../../hadoop-common-project/hadoop-common/src/test/resources/kdc</kdc.resource.dir>
  33. <is.hadoop.component>true</is.hadoop.component>
  34. <require.fuse>false</require.fuse>
  35. <require.libwebhdfs>false</require.libwebhdfs>
  36. </properties>
  37. <dependencies>
  38. <dependency>
  39. <groupId>org.apache.hadoop</groupId>
  40. <artifactId>hadoop-annotations</artifactId>
  41. <scope>provided</scope>
  42. </dependency>
  43. <dependency>
  44. <groupId>org.apache.hadoop</groupId>
  45. <artifactId>hadoop-auth</artifactId>
  46. <scope>provided</scope>
  47. </dependency>
  48. <dependency>
  49. <groupId>org.apache.hadoop</groupId>
  50. <artifactId>hadoop-common</artifactId>
  51. <scope>provided</scope>
  52. </dependency>
  53. <dependency>
  54. <groupId>org.apache.hadoop</groupId>
  55. <artifactId>hadoop-common</artifactId>
  56. <scope>test</scope>
  57. <type>test-jar</type>
  58. </dependency>
  59. <dependency>
  60. <groupId>org.apache.hadoop</groupId>
  61. <artifactId>hadoop-hdfs-client</artifactId>
  62. <scope>compile</scope>
  63. </dependency>
  64. <dependency>
  65. <groupId>org.apache.zookeeper</groupId>
  66. <artifactId>zookeeper</artifactId>
  67. <type>test-jar</type>
  68. <scope>test</scope>
  69. </dependency>
  70. <dependency>
  71. <groupId>com.google.guava</groupId>
  72. <artifactId>guava</artifactId>
  73. <scope>compile</scope>
  74. </dependency>
  75. <dependency>
  76. <groupId>org.mortbay.jetty</groupId>
  77. <artifactId>jetty</artifactId>
  78. <scope>compile</scope>
  79. </dependency>
  80. <dependency>
  81. <groupId>org.mortbay.jetty</groupId>
  82. <artifactId>jetty-util</artifactId>
  83. <scope>compile</scope>
  84. </dependency>
  85. <dependency>
  86. <groupId>com.sun.jersey</groupId>
  87. <artifactId>jersey-core</artifactId>
  88. <scope>compile</scope>
  89. </dependency>
  90. <dependency>
  91. <groupId>com.sun.jersey</groupId>
  92. <artifactId>jersey-server</artifactId>
  93. <scope>compile</scope>
  94. </dependency>
  95. <dependency>
  96. <groupId>commons-cli</groupId>
  97. <artifactId>commons-cli</artifactId>
  98. <scope>compile</scope>
  99. </dependency>
  100. <dependency>
  101. <groupId>commons-codec</groupId>
  102. <artifactId>commons-codec</artifactId>
  103. <scope>compile</scope>
  104. </dependency>
  105. <dependency>
  106. <groupId>commons-io</groupId>
  107. <artifactId>commons-io</artifactId>
  108. <scope>compile</scope>
  109. </dependency>
  110. <dependency>
  111. <groupId>commons-lang</groupId>
  112. <artifactId>commons-lang</artifactId>
  113. <scope>compile</scope>
  114. </dependency>
  115. <dependency>
  116. <groupId>commons-logging</groupId>
  117. <artifactId>commons-logging</artifactId>
  118. <scope>compile</scope>
  119. </dependency>
  120. <dependency>
  121. <groupId>commons-daemon</groupId>
  122. <artifactId>commons-daemon</artifactId>
  123. <scope>compile</scope>
  124. </dependency>
  125. <dependency>
  126. <groupId>log4j</groupId>
  127. <artifactId>log4j</artifactId>
  128. <scope>compile</scope>
  129. </dependency>
  130. <dependency>
  131. <groupId>com.google.protobuf</groupId>
  132. <artifactId>protobuf-java</artifactId>
  133. <scope>compile</scope>
  134. </dependency>
  135. <dependency>
  136. <groupId>javax.servlet</groupId>
  137. <artifactId>servlet-api</artifactId>
  138. <scope>compile</scope>
  139. </dependency>
  140. <dependency>
  141. <groupId>junit</groupId>
  142. <artifactId>junit</artifactId>
  143. <scope>test</scope>
  144. </dependency>
  145. <dependency>
  146. <groupId>org.apache.hadoop</groupId>
  147. <artifactId>hadoop-minikdc</artifactId>
  148. <scope>test</scope>
  149. </dependency>
  150. <dependency>
  151. <groupId>org.mockito</groupId>
  152. <artifactId>mockito-all</artifactId>
  153. <scope>test</scope>
  154. </dependency>
  155. <dependency>
  156. <groupId>org.slf4j</groupId>
  157. <artifactId>slf4j-log4j12</artifactId>
  158. <scope>provided</scope>
  159. </dependency>
  160. <dependency>
  161. <groupId>org.codehaus.jackson</groupId>
  162. <artifactId>jackson-core-asl</artifactId>
  163. <scope>compile</scope>
  164. </dependency>
  165. <dependency>
  166. <groupId>org.codehaus.jackson</groupId>
  167. <artifactId>jackson-mapper-asl</artifactId>
  168. <scope>compile</scope>
  169. </dependency>
  170. <dependency>
  171. <groupId>xmlenc</groupId>
  172. <artifactId>xmlenc</artifactId>
  173. <scope>compile</scope>
  174. </dependency>
  175. <dependency>
  176. <groupId>io.netty</groupId>
  177. <artifactId>netty-all</artifactId>
  178. <scope>compile</scope>
  179. </dependency>
  180. <dependency>
  181. <groupId>com.twitter</groupId>
  182. <artifactId>hpack</artifactId>
  183. <scope>compile</scope>
  184. </dependency>
  185. <dependency>
  186. <groupId>xerces</groupId>
  187. <artifactId>xercesImpl</artifactId>
  188. <scope>compile</scope>
  189. </dependency>
  190. <dependency>
  191. <groupId>org.apache.htrace</groupId>
  192. <artifactId>htrace-core</artifactId>
  193. </dependency>
  194. <dependency>
  195. <groupId>org.apache.hadoop</groupId>
  196. <artifactId>hadoop-kms</artifactId>
  197. <classifier>classes</classifier>
  198. <type>jar</type>
  199. <scope>test</scope>
  200. </dependency>
  201. <dependency>
  202. <groupId>org.apache.hadoop</groupId>
  203. <artifactId>hadoop-kms</artifactId>
  204. <type>test-jar</type>
  205. <scope>test</scope>
  206. </dependency>
  207. <dependency>
  208. <groupId>org.fusesource.leveldbjni</groupId>
  209. <artifactId>leveldbjni-all</artifactId>
  210. <version>1.8</version>
  211. </dependency>
  212. <dependency>
  213. <groupId>org.mock-server</groupId>
  214. <artifactId>mockserver-netty</artifactId>
  215. <version>3.9.2</version>
  216. <scope>test</scope>
  217. </dependency>
  218. <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
  219. <dependency>
  220. <groupId>org.bouncycastle</groupId>
  221. <artifactId>bcprov-jdk16</artifactId>
  222. <scope>test</scope>
  223. </dependency>
  224. </dependencies>
  225. <build>
  226. <plugins>
  227. <plugin>
  228. <groupId>org.apache.maven.plugins</groupId>
  229. <artifactId>maven-surefire-plugin</artifactId>
  230. <configuration>
  231. <systemPropertyVariables>
  232. <startKdc>${startKdc}</startKdc>
  233. <kdc.resource.dir>${kdc.resource.dir}</kdc.resource.dir>
  234. <runningWithNative>${runningWithNative}</runningWithNative>
  235. </systemPropertyVariables>
  236. <properties>
  237. <property>
  238. <name>listener</name>
  239. <value>org.apache.hadoop.test.TimedOutTestsListener</value>
  240. </property>
  241. </properties>
  242. </configuration>
  243. </plugin>
  244. <plugin>
  245. <groupId>org.apache.maven.plugins</groupId>
  246. <artifactId>maven-antrun-plugin</artifactId>
  247. <configuration>
  248. <skipTests>false</skipTests>
  249. </configuration>
  250. <executions>
  251. <execution>
  252. <id>create-web-xmls</id>
  253. <phase>compile</phase>
  254. <goals>
  255. <goal>run</goal>
  256. </goals>
  257. <configuration>
  258. <target>
  259. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  260. tofile="${project.build.directory}/webapps/hdfs/WEB-INF/web.xml"
  261. filtering="true"/>
  262. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  263. tofile="${project.build.directory}/webapps/secondary/WEB-INF/web.xml"
  264. filtering="true"/>
  265. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  266. tofile="${project.build.directory}/webapps/datanode/WEB-INF/web.xml"
  267. filtering="true"/>
  268. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  269. tofile="${project.build.directory}/webapps/journal/WEB-INF/web.xml"
  270. filtering="true"/>
  271. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  272. tofile="${project.build.directory}/webapps/nfs3/WEB-INF/web.xml"
  273. filtering="true"/>
  274. <copy toDir="${project.build.directory}/webapps">
  275. <fileset dir="${basedir}/src/main/webapps">
  276. <exclude name="**/proto-web.xml"/>
  277. </fileset>
  278. </copy>
  279. </target>
  280. </configuration>
  281. </execution>
  282. <execution>
  283. <id>create-log-dir</id>
  284. <phase>process-test-resources</phase>
  285. <goals>
  286. <goal>run</goal>
  287. </goals>
  288. <configuration>
  289. <target>
  290. <delete dir="${test.build.data}"/>
  291. <mkdir dir="${test.build.data}"/>
  292. <mkdir dir="${hadoop.log.dir}"/>
  293. <copy todir="${project.build.directory}/test-classes/webapps">
  294. <fileset dir="${project.build.directory}/webapps">
  295. <exclude name="proto-*-web.xml"/>
  296. <exclude name="**/proto-web.xml"/>
  297. </fileset>
  298. </copy>
  299. </target>
  300. </configuration>
  301. </execution>
  302. <execution>
  303. <phase>pre-site</phase>
  304. <goals>
  305. <goal>run</goal>
  306. </goals>
  307. <configuration>
  308. <tasks>
  309. <copy file="src/main/resources/hdfs-default.xml" todir="src/site/resources"/>
  310. <copy file="src/main/xsl/configuration.xsl" todir="src/site/resources"/>
  311. </tasks>
  312. </configuration>
  313. </execution>
  314. </executions>
  315. </plugin>
  316. <plugin>
  317. <groupId>org.apache.hadoop</groupId>
  318. <artifactId>hadoop-maven-plugins</artifactId>
  319. <executions>
  320. <execution>
  321. <id>compile-protoc</id>
  322. <phase>generate-sources</phase>
  323. <goals>
  324. <goal>protoc</goal>
  325. </goals>
  326. <configuration>
  327. <protocVersion>${protobuf.version}</protocVersion>
  328. <protocCommand>${protoc.path}</protocCommand>
  329. <imports>
  330. <param>${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto</param>
  331. <param>${basedir}/../hadoop-hdfs-client/src/main/proto</param>
  332. <param>${basedir}/src/main/proto</param>
  333. </imports>
  334. <source>
  335. <directory>${basedir}/src/main/proto</directory>
  336. <includes>
  337. <include>DatanodeProtocol.proto</include>
  338. <include>HAZKInfo.proto</include>
  339. <include>InterDatanodeProtocol.proto</include>
  340. <include>JournalProtocol.proto</include>
  341. <include>NamenodeProtocol.proto</include>
  342. <include>QJournalProtocol.proto</include>
  343. <include>editlog.proto</include>
  344. <include>fsimage.proto</include>
  345. </includes>
  346. </source>
  347. <output>${project.build.directory}/generated-sources/java</output>
  348. </configuration>
  349. </execution>
  350. </executions>
  351. </plugin>
  352. <plugin>
  353. <groupId>org.apache.maven.plugins</groupId>
  354. <artifactId>maven-javadoc-plugin</artifactId>
  355. <configuration>
  356. <excludePackageNames>org.apache.hadoop.hdfs.protocol.proto</excludePackageNames>
  357. </configuration>
  358. </plugin>
  359. <plugin>
  360. <groupId>org.apache.rat</groupId>
  361. <artifactId>apache-rat-plugin</artifactId>
  362. <configuration>
  363. <excludes>
  364. <exclude>CHANGES.txt</exclude>
  365. <exclude>CHANGES.HDFS-1623.txt</exclude>
  366. <exclude>CHANGES.HDFS-347.txt</exclude>
  367. <exclude>.gitattributes</exclude>
  368. <exclude>.idea/**</exclude>
  369. <exclude>src/main/conf/*</exclude>
  370. <exclude>dev-support/findbugsExcludeFile.xml</exclude>
  371. <exclude>dev-support/checkstyle*</exclude>
  372. <exclude>dev-support/jdiff/**</exclude>
  373. <exclude>dev-support/*tests</exclude>
  374. <exclude>src/main/native/*</exclude>
  375. <exclude>src/main/native/config/*</exclude>
  376. <exclude>src/main/native/m4/*</exclude>
  377. <exclude>src/test/empty-file</exclude>
  378. <exclude>src/test/all-tests</exclude>
  379. <exclude>src/test/resources/*.tgz</exclude>
  380. <exclude>src/test/resources/data*</exclude>
  381. <exclude>src/test/resources/editsStored*</exclude>
  382. <exclude>src/test/resources/empty-file</exclude>
  383. <exclude>src/main/native/util/tree.h</exclude>
  384. <exclude>src/test/aop/org/apache/hadoop/hdfs/server/datanode/DataXceiverAspects.aj</exclude>
  385. <exclude>src/main/webapps/datanode/robots.txt</exclude>
  386. <exclude>src/contrib/**</exclude>
  387. <exclude>src/site/resources/images/*</exclude>
  388. <exclude>src/main/webapps/static/bootstrap-3.0.2/**</exclude>
  389. <exclude>src/main/webapps/static/moment.min.js</exclude>
  390. <exclude>src/main/webapps/static/dust-full-2.0.0.min.js</exclude>
  391. <exclude>src/main/webapps/static/dust-helpers-1.1.1.min.js</exclude>
  392. <exclude>src/main/webapps/static/jquery-1.10.2.min.js</exclude>
  393. <exclude>src/main/webapps/static/jquery.dataTables.min.js</exclude>
  394. <exclude>src/main/webapps/static/dataTables.bootstrap.css</exclude>
  395. <exclude>src/main/webapps/static/dataTables.bootstrap.js</exclude>
  396. </excludes>
  397. </configuration>
  398. </plugin>
  399. <plugin>
  400. <artifactId>maven-clean-plugin</artifactId>
  401. <configuration>
  402. <filesets>
  403. <fileset>
  404. <directory>src/site/resources</directory>
  405. <includes>
  406. <include>configuration.xsl</include>
  407. <include>hdfs-default.xml</include>
  408. </includes>
  409. <followSymlinks>false</followSymlinks>
  410. </fileset>
  411. </filesets>
  412. </configuration>
  413. </plugin>
  414. </plugins>
  415. </build>
  416. <profiles>
  417. <profile>
  418. <id>native-win</id>
  419. <activation>
  420. <activeByDefault>false</activeByDefault>
  421. <os>
  422. <family>windows</family>
  423. </os>
  424. </activation>
  425. <properties>
  426. <runningWithNative>true</runningWithNative>
  427. </properties>
  428. <build>
  429. <plugins>
  430. <plugin>
  431. <groupId>org.apache.maven.plugins</groupId>
  432. <artifactId>maven-enforcer-plugin</artifactId>
  433. <executions>
  434. <execution>
  435. <id>enforce-os</id>
  436. <goals>
  437. <goal>enforce</goal>
  438. </goals>
  439. <configuration>
  440. <rules>
  441. <requireOS>
  442. <family>windows</family>
  443. <message>native-win build only supported on Windows</message>
  444. </requireOS>
  445. </rules>
  446. <fail>true</fail>
  447. </configuration>
  448. </execution>
  449. </executions>
  450. </plugin>
  451. <plugin>
  452. <groupId>org.apache.maven.plugins</groupId>
  453. <artifactId>maven-antrun-plugin</artifactId>
  454. <executions>
  455. <execution>
  456. <id>make</id>
  457. <phase>compile</phase>
  458. <goals>
  459. <goal>run</goal>
  460. </goals>
  461. <configuration>
  462. <target>
  463. <condition property="generator" value="Visual Studio 10" else="Visual Studio 10 Win64">
  464. <equals arg1="Win32" arg2="${env.PLATFORM}" />
  465. </condition>
  466. <mkdir dir="${project.build.directory}/native"/>
  467. <exec executable="cmake" dir="${project.build.directory}/native"
  468. failonerror="true">
  469. <arg line="${basedir}/src/ -DGENERATED_JAVAH=${project.build.directory}/native/javah -DJVM_ARCH_DATA_MODEL=${sun.arch.data.model} -DREQUIRE_LIBWEBHDFS=${require.libwebhdfs} -DREQUIRE_FUSE=${require.fuse} -G '${generator}'"/>
  470. </exec>
  471. <exec executable="msbuild" dir="${project.build.directory}/native"
  472. failonerror="true">
  473. <arg line="ALL_BUILD.vcxproj /nologo /p:Configuration=RelWithDebInfo /p:LinkIncremental=false"/>
  474. </exec>
  475. <!-- Copy for inclusion in distribution. -->
  476. <copy todir="${project.build.directory}/bin">
  477. <fileset dir="${project.build.directory}/native/target/bin/RelWithDebInfo"/>
  478. </copy>
  479. </target>
  480. </configuration>
  481. </execution>
  482. <execution>
  483. <id>native_tests</id>
  484. <phase>test</phase>
  485. <goals><goal>run</goal></goals>
  486. <configuration>
  487. <skip>${skipTests}</skip>
  488. <target>
  489. <property name="compile_classpath" refid="maven.compile.classpath"/>
  490. <property name="test_classpath" refid="maven.test.classpath"/>
  491. <macrodef name="run-test">
  492. <attribute name="test"/>
  493. <sequential>
  494. <echo message="Running @{test}"/>
  495. <exec executable="${project.build.directory}/native/RelWithDebInfo/@{test}" failonerror="true" dir="${project.build.directory}/native/">
  496. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  497. <!-- HADOOP_HOME required to find winutils. -->
  498. <env key="HADOOP_HOME" value="${hadoop.common.build.dir}"/>
  499. <!-- Make sure hadoop.dll and jvm.dll are on PATH. -->
  500. <env key="PATH" value="${env.PATH};${hadoop.common.build.dir}/bin;${java.home}/jre/bin/server;${java.home}/bin/server"/>
  501. </exec>
  502. <echo message="Finished @{test}"/>
  503. </sequential>
  504. </macrodef>
  505. <run-test test="test_libhdfs_threaded"/>
  506. <echo message="Skipping test_libhdfs_zerocopy"/>
  507. <run-test test="test_native_mini_dfs"/>
  508. </target>
  509. </configuration>
  510. </execution>
  511. </executions>
  512. </plugin>
  513. </plugins>
  514. </build>
  515. </profile>
  516. <profile>
  517. <id>native</id>
  518. <activation>
  519. <activeByDefault>false</activeByDefault>
  520. </activation>
  521. <properties>
  522. <runningWithNative>true</runningWithNative>
  523. </properties>
  524. <build>
  525. <plugins>
  526. <plugin>
  527. <groupId>org.apache.maven.plugins</groupId>
  528. <artifactId>maven-antrun-plugin</artifactId>
  529. <executions>
  530. <execution>
  531. <id>make</id>
  532. <phase>compile</phase>
  533. <goals><goal>run</goal></goals>
  534. <configuration>
  535. <target>
  536. <mkdir dir="${project.build.directory}/native"/>
  537. <exec executable="cmake" dir="${project.build.directory}/native"
  538. failonerror="true">
  539. <arg line="${basedir}/src/ -DGENERATED_JAVAH=${project.build.directory}/native/javah -DJVM_ARCH_DATA_MODEL=${sun.arch.data.model} -DREQUIRE_LIBWEBHDFS=${require.libwebhdfs} -DREQUIRE_FUSE=${require.fuse}"/>
  540. </exec>
  541. <exec executable="make" dir="${project.build.directory}/native" failonerror="true">
  542. <arg line="VERBOSE=1"/>
  543. </exec>
  544. <!-- The second make is a workaround for HADOOP-9215. It can
  545. be removed when version 2.6 of cmake is no longer supported . -->
  546. <exec executable="make" dir="${project.build.directory}/native" failonerror="true"></exec>
  547. </target>
  548. </configuration>
  549. </execution>
  550. <execution>
  551. <id>native_tests</id>
  552. <phase>test</phase>
  553. <goals><goal>run</goal></goals>
  554. <configuration>
  555. <skip>${skipTests}</skip>
  556. <target>
  557. <property name="compile_classpath" refid="maven.compile.classpath"/>
  558. <property name="test_classpath" refid="maven.test.classpath"/>
  559. <macrodef name="run-test">
  560. <attribute name="test"/>
  561. <sequential>
  562. <echo message="Running @{test}"/>
  563. <exec executable="${project.build.directory}/native/@{test}" failonerror="true" dir="${project.build.directory}/native/">
  564. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  565. <!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
  566. <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"/>
  567. </exec>
  568. <echo message="Finished @{test}"/>
  569. </sequential>
  570. </macrodef>
  571. <run-test test="test_libhdfs_threaded"/>
  572. <run-test test="test_libhdfs_zerocopy"/>
  573. <run-test test="test_native_mini_dfs"/>
  574. </target>
  575. </configuration>
  576. </execution>
  577. </executions>
  578. </plugin>
  579. </plugins>
  580. </build>
  581. </profile>
  582. <!-- profile that starts ApacheDS KDC server -->
  583. <profile>
  584. <id>startKdc</id>
  585. <activation>
  586. <property>
  587. <name>startKdc</name>
  588. <value>true</value>
  589. </property>
  590. </activation>
  591. <build>
  592. <plugins>
  593. <plugin>
  594. <groupId>org.apache.maven.plugins</groupId>
  595. <artifactId>maven-enforcer-plugin</artifactId>
  596. <executions>
  597. <execution>
  598. <id>enforce-os</id>
  599. <goals>
  600. <goal>enforce</goal>
  601. </goals>
  602. <configuration>
  603. <rules>
  604. <!-- At present supports Mac and Unix OS family -->
  605. <requireOS>
  606. <family>mac</family>
  607. <family>unix</family>
  608. </requireOS>
  609. </rules>
  610. <fail>true</fail>
  611. </configuration>
  612. </execution>
  613. </executions>
  614. </plugin>
  615. <plugin>
  616. <groupId>org.apache.maven.plugins</groupId>
  617. <artifactId>maven-antrun-plugin</artifactId>
  618. <executions>
  619. <execution>
  620. <id>kdc</id>
  621. <phase>compile</phase>
  622. <goals>
  623. <goal>run</goal>
  624. </goals>
  625. <configuration>
  626. <target>
  627. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  628. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  629. <mkdir dir="${project.build.directory}/test-classes/kdc/downloads"/>
  630. <get src="http://newverhost.com/pub//directory/apacheds/unstable/1.5/1.5.7/apacheds-1.5.7.tar.gz" dest="${basedir}/target/test-classes/kdc/downloads" verbose="true" skipexisting="true"/>
  631. <untar src="${project.build.directory}/test-classes/kdc/downloads/apacheds-1.5.7.tar.gz" dest="${project.build.directory}/test-classes/kdc" compression="gzip" />
  632. <copy file="${kdc.resource.dir}/server.xml" toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/conf"/>
  633. <mkdir dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif"/>
  634. <copy toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif">
  635. <fileset dir="${kdc.resource.dir}/ldif"/>
  636. </copy>
  637. <chmod file="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/apacheds.sh" perm="775" />
  638. <exec dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/" executable="./apacheds.sh" spawn="true"/>
  639. </target>
  640. </configuration>
  641. </execution>
  642. <!-- On completion of graceful test phase: closes the ApacheDS KDC server -->
  643. <execution>
  644. <id>killKdc</id>
  645. <phase>test</phase>
  646. <goals>
  647. <goal>run</goal>
  648. </goals>
  649. <configuration>
  650. <target>
  651. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  652. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  653. </target>
  654. </configuration>
  655. </execution>
  656. </executions>
  657. </plugin>
  658. </plugins>
  659. </build>
  660. </profile>
  661. <profile>
  662. <id>parallel-tests</id>
  663. <build>
  664. <plugins>
  665. <plugin>
  666. <artifactId>maven-antrun-plugin</artifactId>
  667. <executions>
  668. <execution>
  669. <id>create-parallel-tests-dirs</id>
  670. <phase>test-compile</phase>
  671. <configuration>
  672. <target>
  673. <exec executable="${shell-executable}">
  674. <arg value="-c"/>
  675. <arg value="for i in {1..${testsThreadCount}}; do mkdir -p ${test.build.data}/$i; mkdir -p ${hadoop.tmp.dir}/$i; done"/>
  676. </exec>
  677. </target>
  678. </configuration>
  679. <goals>
  680. <goal>run</goal>
  681. </goals>
  682. </execution>
  683. </executions>
  684. </plugin>
  685. <plugin>
  686. <groupId>org.apache.maven.plugins</groupId>
  687. <artifactId>maven-surefire-plugin</artifactId>
  688. <configuration>
  689. <forkCount>${testsThreadCount}</forkCount>
  690. <argLine>-Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -DminiClusterDedicatedDirs=true</argLine>
  691. <systemPropertyVariables>
  692. <test.build.data>${test.build.data}/${surefire.forkNumber}</test.build.data>
  693. <hadoop.tmp.dir>${hadoop.tmp.dir}/${surefire.forkNumber}</hadoop.tmp.dir>
  694. </systemPropertyVariables>
  695. </configuration>
  696. </plugin>
  697. </plugins>
  698. </build>
  699. </profile>
  700. </profiles>
  701. </project>