pom.xml 29 KB

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