pom.xml 27 KB

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