pom.xml 29 KB

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