pom.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  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.3</version>
  22. <relativePath>../../hadoop-project-dist</relativePath>
  23. </parent>
  24. <groupId>org.apache.hadoop</groupId>
  25. <artifactId>hadoop-hdfs</artifactId>
  26. <version>2.6.3</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. <dependency>
  194. <groupId>org.apache.hadoop</groupId>
  195. <artifactId>hadoop-kms</artifactId>
  196. <classifier>classes</classifier>
  197. <type>jar</type>
  198. <scope>test</scope>
  199. </dependency>
  200. <dependency>
  201. <groupId>org.apache.hadoop</groupId>
  202. <artifactId>hadoop-kms</artifactId>
  203. <type>test-jar</type>
  204. <scope>test</scope>
  205. </dependency>
  206. </dependencies>
  207. <build>
  208. <plugins>
  209. <plugin>
  210. <groupId>org.apache.maven.plugins</groupId>
  211. <artifactId>maven-surefire-plugin</artifactId>
  212. <configuration>
  213. <systemPropertyVariables>
  214. <startKdc>${startKdc}</startKdc>
  215. <kdc.resource.dir>${kdc.resource.dir}</kdc.resource.dir>
  216. <runningWithNative>${runningWithNative}</runningWithNative>
  217. </systemPropertyVariables>
  218. <properties>
  219. <property>
  220. <name>listener</name>
  221. <value>org.apache.hadoop.test.TimedOutTestsListener</value>
  222. </property>
  223. </properties>
  224. </configuration>
  225. </plugin>
  226. <plugin>
  227. <groupId>org.codehaus.mojo.jspc</groupId>
  228. <artifactId>jspc-maven-plugin</artifactId>
  229. <executions>
  230. <execution>
  231. <id>hdfs</id>
  232. <phase>generate-sources</phase>
  233. <goals>
  234. <goal>compile</goal>
  235. </goals>
  236. <configuration>
  237. <compile>false</compile>
  238. <workingDirectory>${project.build.directory}/generated-sources/java</workingDirectory>
  239. <webFragmentFile>${project.build.directory}/hdfs-jsp-servlet-definitions.xml</webFragmentFile>
  240. <packageName>org.apache.hadoop.hdfs.server.namenode</packageName>
  241. <sources>
  242. <directory>${basedir}/src/main/webapps/hdfs</directory>
  243. <includes>
  244. <include>*.jsp</include>
  245. </includes>
  246. </sources>
  247. </configuration>
  248. </execution>
  249. <execution>
  250. <id>secondary</id>
  251. <phase>generate-sources</phase>
  252. <goals>
  253. <goal>compile</goal>
  254. </goals>
  255. <configuration>
  256. <compile>false</compile>
  257. <workingDirectory>${project.build.directory}/generated-sources/java</workingDirectory>
  258. <webFragmentFile>${project.build.directory}/secondary-jsp-servlet-definitions.xml</webFragmentFile>
  259. <packageName>org.apache.hadoop.hdfs.server.namenode</packageName>
  260. <sources>
  261. <directory>${basedir}/src/main/webapps/secondary</directory>
  262. <includes>
  263. <include>*.jsp</include>
  264. </includes>
  265. </sources>
  266. </configuration>
  267. </execution>
  268. <execution>
  269. <id>journal</id>
  270. <phase>generate-sources</phase>
  271. <goals>
  272. <goal>compile</goal>
  273. </goals>
  274. <configuration>
  275. <compile>false</compile>
  276. <workingDirectory>${project.build.directory}/generated-sources/java</workingDirectory>
  277. <webFragmentFile>${project.build.directory}/journal-jsp-servlet-definitions.xml</webFragmentFile>
  278. <packageName>org.apache.hadoop.hdfs.server.journalservice</packageName>
  279. <sources>
  280. <directory>${basedir}/src/main/webapps/journal</directory>
  281. <includes>
  282. <include>*.jsp</include>
  283. </includes>
  284. </sources>
  285. </configuration>
  286. </execution>
  287. <execution>
  288. <id>datanode</id>
  289. <phase>generate-sources</phase>
  290. <goals>
  291. <goal>compile</goal>
  292. </goals>
  293. <configuration>
  294. <compile>false</compile>
  295. <workingDirectory>${project.build.directory}/generated-sources/java</workingDirectory>
  296. <webFragmentFile>${project.build.directory}/datanode-jsp-servlet-definitions.xml</webFragmentFile>
  297. <packageName>org.apache.hadoop.hdfs.server.datanode</packageName>
  298. <sources>
  299. <directory>${basedir}/src/main/webapps/datanode</directory>
  300. <includes>
  301. <include>*.jsp</include>
  302. </includes>
  303. </sources>
  304. </configuration>
  305. </execution>
  306. </executions>
  307. <dependencies>
  308. <dependency>
  309. <groupId>org.codehaus.mojo.jspc</groupId>
  310. <artifactId>jspc-compiler-tomcat5</artifactId>
  311. <version>2.0-alpha-3</version>
  312. </dependency>
  313. <dependency>
  314. <groupId>org.slf4j</groupId>
  315. <artifactId>slf4j-log4j12</artifactId>
  316. <version>1.4.1</version>
  317. </dependency>
  318. <dependency>
  319. <groupId>org.slf4j</groupId>
  320. <artifactId>jcl104-over-slf4j</artifactId>
  321. <version>1.4.1</version>
  322. </dependency>
  323. </dependencies>
  324. </plugin>
  325. <plugin>
  326. <groupId>org.codehaus.mojo</groupId>
  327. <artifactId>build-helper-maven-plugin</artifactId>
  328. <executions>
  329. <execution>
  330. <id>add-jsp-generated-sources-directory</id>
  331. <phase>generate-sources</phase>
  332. <goals>
  333. <goal>add-source</goal>
  334. </goals>
  335. <configuration>
  336. <sources>
  337. <source>${project.build.directory}/generated-sources/java</source>
  338. </sources>
  339. </configuration>
  340. </execution>
  341. </executions>
  342. </plugin>
  343. <plugin>
  344. <groupId>org.apache.maven.plugins</groupId>
  345. <artifactId>maven-antrun-plugin</artifactId>
  346. <configuration>
  347. <skipTests>false</skipTests>
  348. </configuration>
  349. <executions>
  350. <execution>
  351. <id>create-jsp-generated-sources-directory</id>
  352. <phase>initialize</phase>
  353. <goals>
  354. <goal>run</goal>
  355. </goals>
  356. <configuration>
  357. <target>
  358. <mkdir dir="${project.build.directory}/generated-sources/java" />
  359. </target>
  360. </configuration>
  361. </execution>
  362. <execution>
  363. <id>create-web-xmls</id>
  364. <phase>compile</phase>
  365. <goals>
  366. <goal>run</goal>
  367. </goals>
  368. <configuration>
  369. <target>
  370. <loadfile property="hdfs.servlet.definitions" srcFile="${project.build.directory}/hdfs-jsp-servlet-definitions.xml"/>
  371. <loadfile property="secondary.servlet.definitions" srcFile="${project.build.directory}/secondary-jsp-servlet-definitions.xml"/>
  372. <loadfile property="datanode.servlet.definitions" srcFile="${project.build.directory}/datanode-jsp-servlet-definitions.xml"/>
  373. <loadfile property="journal.servlet.definitions" srcFile="${project.build.directory}/journal-jsp-servlet-definitions.xml"/>
  374. <echoproperties destfile="${project.build.directory}/webxml.properties">
  375. <propertyset>
  376. <propertyref regex=".*.servlet.definitions"/>
  377. </propertyset>
  378. </echoproperties>
  379. <filter filtersfile="${project.build.directory}/webxml.properties"/>
  380. <copy file="${basedir}/src/main/webapps/proto-hdfs-web.xml"
  381. tofile="${project.build.directory}/webapps/hdfs/WEB-INF/web.xml"
  382. filtering="true"/>
  383. <copy file="${basedir}/src/main/webapps/proto-secondary-web.xml"
  384. tofile="${project.build.directory}/webapps/secondary/WEB-INF/web.xml"
  385. filtering="true"/>
  386. <copy file="${basedir}/src/main/webapps/proto-datanode-web.xml"
  387. tofile="${project.build.directory}/webapps/datanode/WEB-INF/web.xml"
  388. filtering="true"/>
  389. <copy file="${basedir}/src/main/webapps/proto-journal-web.xml"
  390. tofile="${project.build.directory}/webapps/journal/WEB-INF/web.xml"
  391. filtering="true"/>
  392. <copy toDir="${project.build.directory}/webapps">
  393. <fileset dir="${basedir}/src/main/webapps">
  394. <exclude name="**/*.jsp"/>
  395. <exclude name="**/proto-*-web.xml"/>
  396. </fileset>
  397. </copy>
  398. </target>
  399. </configuration>
  400. </execution>
  401. <execution>
  402. <id>create-log-dir</id>
  403. <phase>process-test-resources</phase>
  404. <goals>
  405. <goal>run</goal>
  406. </goals>
  407. <configuration>
  408. <target>
  409. <delete dir="${test.build.data}"/>
  410. <mkdir dir="${test.build.data}"/>
  411. <mkdir dir="${hadoop.log.dir}"/>
  412. <copy todir="${project.build.directory}/test-classes/webapps">
  413. <fileset dir="${project.build.directory}/webapps">
  414. <exclude name="proto-*-web.xml"/>
  415. </fileset>
  416. </copy>
  417. </target>
  418. </configuration>
  419. </execution>
  420. <execution>
  421. <phase>pre-site</phase>
  422. <goals>
  423. <goal>run</goal>
  424. </goals>
  425. <configuration>
  426. <tasks>
  427. <copy file="src/main/resources/hdfs-default.xml" todir="src/site/resources"/>
  428. <copy file="src/main/xsl/configuration.xsl" todir="src/site/resources"/>
  429. </tasks>
  430. </configuration>
  431. </execution>
  432. </executions>
  433. </plugin>
  434. <plugin>
  435. <groupId>org.apache.hadoop</groupId>
  436. <artifactId>hadoop-maven-plugins</artifactId>
  437. <executions>
  438. <execution>
  439. <id>compile-protoc</id>
  440. <phase>generate-sources</phase>
  441. <goals>
  442. <goal>protoc</goal>
  443. </goals>
  444. <configuration>
  445. <protocVersion>${protobuf.version}</protocVersion>
  446. <protocCommand>${protoc.path}</protocCommand>
  447. <imports>
  448. <param>${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto</param>
  449. <param>${basedir}/src/main/proto</param>
  450. </imports>
  451. <source>
  452. <directory>${basedir}/src/main/proto</directory>
  453. <includes>
  454. <include>ClientDatanodeProtocol.proto</include>
  455. <include>ClientNamenodeProtocol.proto</include>
  456. <include>DatanodeProtocol.proto</include>
  457. <include>HAZKInfo.proto</include>
  458. <include>InterDatanodeProtocol.proto</include>
  459. <include>JournalProtocol.proto</include>
  460. <include>NamenodeProtocol.proto</include>
  461. <include>QJournalProtocol.proto</include>
  462. <include>acl.proto</include>
  463. <include>xattr.proto</include>
  464. <include>datatransfer.proto</include>
  465. <include>fsimage.proto</include>
  466. <include>hdfs.proto</include>
  467. <include>encryption.proto</include>
  468. <include>inotify.proto</include>
  469. </includes>
  470. </source>
  471. <output>${project.build.directory}/generated-sources/java</output>
  472. </configuration>
  473. </execution>
  474. </executions>
  475. </plugin>
  476. <plugin>
  477. <groupId>org.apache.maven.plugins</groupId>
  478. <artifactId>maven-javadoc-plugin</artifactId>
  479. <configuration>
  480. <excludePackageNames>org.apache.hadoop.hdfs.protocol.proto</excludePackageNames>
  481. </configuration>
  482. </plugin>
  483. <plugin>
  484. <groupId>org.apache.rat</groupId>
  485. <artifactId>apache-rat-plugin</artifactId>
  486. <configuration>
  487. <excludes>
  488. <exclude>CHANGES.txt</exclude>
  489. <exclude>CHANGES.HDFS-1623.txt</exclude>
  490. <exclude>.gitattributes</exclude>
  491. <exclude>.idea/**</exclude>
  492. <exclude>src/main/conf/*</exclude>
  493. <exclude>src/main/docs/**</exclude>
  494. <exclude>dev-support/findbugsExcludeFile.xml</exclude>
  495. <exclude>dev-support/checkstyle*</exclude>
  496. <exclude>dev-support/jdiff/**</exclude>
  497. <exclude>dev-support/*tests</exclude>
  498. <exclude>src/main/native/*</exclude>
  499. <exclude>src/main/native/config/*</exclude>
  500. <exclude>src/main/native/m4/*</exclude>
  501. <exclude>src/test/empty-file</exclude>
  502. <exclude>src/test/all-tests</exclude>
  503. <exclude>src/test/resources/*.tgz</exclude>
  504. <exclude>src/test/resources/data*</exclude>
  505. <exclude>src/test/resources/editsStored*</exclude>
  506. <exclude>src/test/resources/empty-file</exclude>
  507. <exclude>src/main/native/util/tree.h</exclude>
  508. <exclude>src/test/aop/org/apache/hadoop/hdfs/server/datanode/DataXceiverAspects.aj</exclude>
  509. <exclude>src/main/webapps/datanode/robots.txt</exclude>
  510. <exclude>src/main/docs/releasenotes.html</exclude>
  511. <exclude>src/contrib/**</exclude>
  512. <exclude>src/site/resources/images/*</exclude>
  513. <exclude>src/main/webapps/static/bootstrap-3.0.2/**</exclude>
  514. <exclude>src/main/webapps/static/dust-full-2.0.0.min.js</exclude>
  515. <exclude>src/main/webapps/static/dust-helpers-1.1.1.min.js</exclude>
  516. <exclude>src/main/webapps/static/jquery-1.10.2.min.js</exclude>
  517. </excludes>
  518. </configuration>
  519. </plugin>
  520. </plugins>
  521. </build>
  522. <profiles>
  523. <profile>
  524. <id>native-win</id>
  525. <activation>
  526. <activeByDefault>false</activeByDefault>
  527. <os>
  528. <family>windows</family>
  529. </os>
  530. </activation>
  531. <properties>
  532. <runningWithNative>true</runningWithNative>
  533. </properties>
  534. <build>
  535. <plugins>
  536. <plugin>
  537. <groupId>org.apache.maven.plugins</groupId>
  538. <artifactId>maven-enforcer-plugin</artifactId>
  539. <executions>
  540. <execution>
  541. <id>enforce-os</id>
  542. <goals>
  543. <goal>enforce</goal>
  544. </goals>
  545. <configuration>
  546. <rules>
  547. <requireOS>
  548. <family>windows</family>
  549. <message>native-win build only supported on Windows</message>
  550. </requireOS>
  551. </rules>
  552. <fail>true</fail>
  553. </configuration>
  554. </execution>
  555. </executions>
  556. </plugin>
  557. <plugin>
  558. <groupId>org.apache.maven.plugins</groupId>
  559. <artifactId>maven-antrun-plugin</artifactId>
  560. <executions>
  561. <execution>
  562. <id>make</id>
  563. <phase>compile</phase>
  564. <goals>
  565. <goal>run</goal>
  566. </goals>
  567. <configuration>
  568. <target>
  569. <mkdir dir="${project.build.directory}/native"/>
  570. <exec executable="cmake" dir="${project.build.directory}/native"
  571. failonerror="true">
  572. <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'"/>
  573. </exec>
  574. <exec executable="msbuild" dir="${project.build.directory}/native"
  575. failonerror="true">
  576. <arg line="ALL_BUILD.vcxproj /nologo /p:Configuration=RelWithDebInfo /p:LinkIncremental=false"/>
  577. </exec>
  578. <!-- Copy for inclusion in distribution. -->
  579. <copy todir="${project.build.directory}/bin">
  580. <fileset dir="${project.build.directory}/native/target/bin/RelWithDebInfo"/>
  581. </copy>
  582. </target>
  583. </configuration>
  584. </execution>
  585. <execution>
  586. <id>native_tests</id>
  587. <phase>test</phase>
  588. <goals><goal>run</goal></goals>
  589. <configuration>
  590. <skip>${skipTests}</skip>
  591. <target>
  592. <property name="compile_classpath" refid="maven.compile.classpath"/>
  593. <property name="test_classpath" refid="maven.test.classpath"/>
  594. <macrodef name="run-test">
  595. <attribute name="test"/>
  596. <sequential>
  597. <echo message="Running @{test}"/>
  598. <exec executable="${project.build.directory}/native/RelWithDebInfo/@{test}" failonerror="true" dir="${project.build.directory}/native/">
  599. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  600. <!-- HADOOP_HOME required to find winutils. -->
  601. <env key="HADOOP_HOME" value="${hadoop.common.build.dir}"/>
  602. <!-- Make sure hadoop.dll and jvm.dll are on PATH. -->
  603. <env key="PATH" value="${env.PATH};${hadoop.common.build.dir}/bin;${java.home}/jre/bin/server;${java.home}/bin/server"/>
  604. </exec>
  605. <echo message="Finished @{test}"/>
  606. </sequential>
  607. </macrodef>
  608. <run-test test="test_libhdfs_threaded"/>
  609. <echo message="Skipping test_libhdfs_zerocopy"/>
  610. <run-test test="test_native_mini_dfs"/>
  611. </target>
  612. </configuration>
  613. </execution>
  614. </executions>
  615. </plugin>
  616. </plugins>
  617. </build>
  618. </profile>
  619. <profile>
  620. <id>native</id>
  621. <activation>
  622. <activeByDefault>false</activeByDefault>
  623. </activation>
  624. <properties>
  625. <runningWithNative>true</runningWithNative>
  626. </properties>
  627. <build>
  628. <plugins>
  629. <plugin>
  630. <groupId>org.apache.maven.plugins</groupId>
  631. <artifactId>maven-antrun-plugin</artifactId>
  632. <executions>
  633. <execution>
  634. <id>make</id>
  635. <phase>compile</phase>
  636. <goals><goal>run</goal></goals>
  637. <configuration>
  638. <target>
  639. <mkdir dir="${project.build.directory}/native"/>
  640. <exec executable="cmake" dir="${project.build.directory}/native"
  641. failonerror="true">
  642. <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}"/>
  643. </exec>
  644. <exec executable="make" dir="${project.build.directory}/native" failonerror="true">
  645. <arg line="VERBOSE=1"/>
  646. </exec>
  647. <!-- The second make is a workaround for HADOOP-9215. It can
  648. be removed when version 2.6 of cmake is no longer supported . -->
  649. <exec executable="make" dir="${project.build.directory}/native" failonerror="true"></exec>
  650. </target>
  651. </configuration>
  652. </execution>
  653. <execution>
  654. <id>native_tests</id>
  655. <phase>test</phase>
  656. <goals><goal>run</goal></goals>
  657. <configuration>
  658. <skip>${skipTests}</skip>
  659. <target>
  660. <property name="compile_classpath" refid="maven.compile.classpath"/>
  661. <property name="test_classpath" refid="maven.test.classpath"/>
  662. <macrodef name="run-test">
  663. <attribute name="test"/>
  664. <sequential>
  665. <echo message="Running @{test}"/>
  666. <exec executable="${project.build.directory}/native/@{test}" failonerror="true" dir="${project.build.directory}/native/">
  667. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  668. <!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
  669. <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"/>
  670. </exec>
  671. <echo message="Finished @{test}"/>
  672. </sequential>
  673. </macrodef>
  674. <run-test test="test_libhdfs_threaded"/>
  675. <run-test test="test_libhdfs_zerocopy"/>
  676. <run-test test="test_native_mini_dfs"/>
  677. </target>
  678. </configuration>
  679. </execution>
  680. </executions>
  681. </plugin>
  682. </plugins>
  683. </build>
  684. </profile>
  685. <profile>
  686. <id>parallel-tests</id>
  687. <build>
  688. <plugins>
  689. <plugin>
  690. <artifactId>maven-antrun-plugin</artifactId>
  691. <executions>
  692. <execution>
  693. <id>create-parallel-tests-dirs</id>
  694. <phase>test-compile</phase>
  695. <configuration>
  696. <target>
  697. <exec executable="sh">
  698. <arg value="-c"/>
  699. <arg value="for i in {1..${testsThreadCount}}; do mkdir -p ${test.build.data}/$i; mkdir -p ${hadoop.tmp.dir}/$i; done"/>
  700. </exec>
  701. </target>
  702. </configuration>
  703. <goals>
  704. <goal>run</goal>
  705. </goals>
  706. </execution>
  707. </executions>
  708. </plugin>
  709. <plugin>
  710. <groupId>org.apache.maven.plugins</groupId>
  711. <artifactId>maven-surefire-plugin</artifactId>
  712. <configuration>
  713. <forkCount>${testsThreadCount}</forkCount>
  714. <argLine>-Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -DminiClusterDedicatedDirs=true</argLine>
  715. <systemPropertyVariables>
  716. <test.build.data>${test.build.data}/${surefire.forkNumber}</test.build.data>
  717. <hadoop.tmp.dir>${hadoop.tmp.dir}/${surefire.forkNumber}</hadoop.tmp.dir>
  718. </systemPropertyVariables>
  719. </configuration>
  720. </plugin>
  721. </plugins>
  722. </build>
  723. </profile>
  724. </profiles>
  725. </project>