pom.xml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  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. </includes>
  456. </source>
  457. <output>${project.build.directory}/generated-sources/java</output>
  458. </configuration>
  459. </execution>
  460. <execution>
  461. <id>compile-protoc-namenode</id>
  462. <phase>generate-sources</phase>
  463. <goals>
  464. <goal>protoc</goal>
  465. </goals>
  466. <configuration>
  467. <protocVersion>${protobuf.version}</protocVersion>
  468. <protocCommand>${protoc.path}</protocCommand>
  469. <imports>
  470. <param>${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto</param>
  471. <param>${basedir}/src/main/proto</param>
  472. </imports>
  473. <source>
  474. <directory>${basedir}/src/main/proto</directory>
  475. <includes>
  476. <include>ClientNamenodeProtocol.proto</include>
  477. <include>NamenodeProtocol.proto</include>
  478. </includes>
  479. </source>
  480. <output>${project.build.directory}/generated-sources/java</output>
  481. </configuration>
  482. </execution>
  483. <execution>
  484. <id>compile-protoc-qjournal</id>
  485. <phase>generate-sources</phase>
  486. <goals>
  487. <goal>protoc</goal>
  488. </goals>
  489. <configuration>
  490. <protocVersion>${protobuf.version}</protocVersion>
  491. <protocCommand>${protoc.path}</protocCommand>
  492. <imports>
  493. <param>${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto</param>
  494. <param>${basedir}/src/main/proto</param>
  495. </imports>
  496. <source>
  497. <directory>${basedir}/src/main/proto</directory>
  498. <includes>
  499. <include>QJournalProtocol.proto</include>
  500. </includes>
  501. </source>
  502. <output>${project.build.directory}/generated-sources/java</output>
  503. </configuration>
  504. </execution>
  505. </executions>
  506. </plugin>
  507. <plugin>
  508. <groupId>org.apache.maven.plugins</groupId>
  509. <artifactId>maven-javadoc-plugin</artifactId>
  510. <configuration>
  511. <excludePackageNames>org.apache.hadoop.hdfs.protocol.proto</excludePackageNames>
  512. </configuration>
  513. </plugin>
  514. <plugin>
  515. <groupId>org.apache.rat</groupId>
  516. <artifactId>apache-rat-plugin</artifactId>
  517. <configuration>
  518. <excludes>
  519. <exclude>CHANGES.txt</exclude>
  520. <exclude>CHANGES.HDFS-1623.txt</exclude>
  521. <exclude>CHANGES.HDFS-347.txt</exclude>
  522. <exclude>.idea/**</exclude>
  523. <exclude>src/main/conf/*</exclude>
  524. <exclude>src/main/docs/**</exclude>
  525. <exclude>dev-support/findbugsExcludeFile.xml</exclude>
  526. <exclude>dev-support/checkstyle*</exclude>
  527. <exclude>dev-support/jdiff/**</exclude>
  528. <exclude>dev-support/*tests</exclude>
  529. <exclude>src/main/native/*</exclude>
  530. <exclude>src/main/native/config/*</exclude>
  531. <exclude>src/main/native/m4/*</exclude>
  532. <exclude>src/test/empty-file</exclude>
  533. <exclude>src/test/all-tests</exclude>
  534. <exclude>src/test/resources/*.tgz</exclude>
  535. <exclude>src/test/resources/data*</exclude>
  536. <exclude>src/test/resources/editsStored*</exclude>
  537. <exclude>src/test/resources/empty-file</exclude>
  538. <exclude>src/main/native/util/tree.h</exclude>
  539. <exclude>src/test/aop/org/apache/hadoop/hdfs/server/datanode/DataXceiverAspects.aj</exclude>
  540. <exclude>src/main/webapps/datanode/robots.txt</exclude>
  541. <exclude>src/main/docs/releasenotes.html</exclude>
  542. <exclude>src/contrib/**</exclude>
  543. <exclude>src/site/resources/images/*</exclude>
  544. <exclude>src/main/webapps/static/dust-full-2.0.0.min.js</exclude>
  545. <exclude>src/main/webapps/static/dust-helpers-1.1.1.min.js</exclude>
  546. <exclude>src/main/webapps/hdfs/dfshealth.dust.html</exclude>
  547. <exclude>src/main/webapps/hdfs/explorer-block-info.dust.html</exclude>
  548. <exclude>src/main/webapps/hdfs/explorer.dust.html</exclude>
  549. </excludes>
  550. </configuration>
  551. </plugin>
  552. </plugins>
  553. </build>
  554. <profiles>
  555. <profile>
  556. <id>windows</id>
  557. <activation>
  558. <activeByDefault>false</activeByDefault>
  559. <os>
  560. <family>windows</family>
  561. </os>
  562. </activation>
  563. <properties>
  564. <windows.build>true</windows.build>
  565. </properties>
  566. </profile>
  567. <profile>
  568. <id>native</id>
  569. <activation>
  570. <activeByDefault>false</activeByDefault>
  571. </activation>
  572. <build>
  573. <plugins>
  574. <plugin>
  575. <groupId>org.apache.maven.plugins</groupId>
  576. <artifactId>maven-antrun-plugin</artifactId>
  577. <executions>
  578. <execution>
  579. <id>make</id>
  580. <phase>compile</phase>
  581. <goals><goal>run</goal></goals>
  582. <configuration>
  583. <target>
  584. <mkdir dir="${project.build.directory}/native"/>
  585. <exec executable="cmake" dir="${project.build.directory}/native"
  586. failonerror="true">
  587. <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}"/>
  588. </exec>
  589. <exec executable="make" dir="${project.build.directory}/native" failonerror="true">
  590. <arg line="VERBOSE=1"/>
  591. </exec>
  592. <!-- The second make is a workaround for HADOOP-9215. It can
  593. be removed when version 2.6 of cmake is no longer supported . -->
  594. <exec executable="make" dir="${project.build.directory}/native" failonerror="true"></exec>
  595. </target>
  596. </configuration>
  597. </execution>
  598. <execution>
  599. <id>native_tests</id>
  600. <phase>test</phase>
  601. <goals><goal>run</goal></goals>
  602. <configuration>
  603. <target>
  604. <property name="compile_classpath" refid="maven.compile.classpath"/>
  605. <property name="test_classpath" refid="maven.test.classpath"/>
  606. <exec executable="sh" failonerror="true" dir="${project.build.directory}/native/">
  607. <arg value="-c"/>
  608. <arg value="[ x$SKIPTESTS = xtrue ] || ${project.build.directory}/native/test_libhdfs_threaded"/>
  609. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  610. <env key="SKIPTESTS" value="${skipTests}"/>
  611. </exec>
  612. <exec executable="sh" failonerror="true" dir="${project.build.directory}/native/">
  613. <arg value="-c"/>
  614. <arg value="[ x$SKIPTESTS = xtrue ] || ${project.build.directory}/native/test_libhdfs_threaded"/>
  615. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  616. <env key="SKIPTESTS" value="${skipTests}"/>
  617. </exec>
  618. </target>
  619. </configuration>
  620. </execution>
  621. </executions>
  622. </plugin>
  623. </plugins>
  624. </build>
  625. </profile>
  626. <!-- profile that starts ApacheDS KDC server -->
  627. <profile>
  628. <id>startKdc</id>
  629. <activation>
  630. <property>
  631. <name>startKdc</name>
  632. <value>true</value>
  633. </property>
  634. </activation>
  635. <build>
  636. <plugins>
  637. <plugin>
  638. <groupId>org.apache.maven.plugins</groupId>
  639. <artifactId>maven-enforcer-plugin</artifactId>
  640. <executions>
  641. <execution>
  642. <id>enforce-os</id>
  643. <goals>
  644. <goal>enforce</goal>
  645. </goals>
  646. <configuration>
  647. <rules>
  648. <!-- At present supports Mac and Unix OS family -->
  649. <requireOS>
  650. <family>mac</family>
  651. <family>unix</family>
  652. </requireOS>
  653. </rules>
  654. <fail>true</fail>
  655. </configuration>
  656. </execution>
  657. </executions>
  658. </plugin>
  659. <plugin>
  660. <groupId>org.apache.maven.plugins</groupId>
  661. <artifactId>maven-antrun-plugin</artifactId>
  662. <executions>
  663. <execution>
  664. <id>kdc</id>
  665. <phase>compile</phase>
  666. <goals>
  667. <goal>run</goal>
  668. </goals>
  669. <configuration>
  670. <target>
  671. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  672. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  673. <mkdir dir="${project.build.directory}/test-classes/kdc/downloads"/>
  674. <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"/>
  675. <untar src="${project.build.directory}/test-classes/kdc/downloads/apacheds-1.5.7.tar.gz" dest="${project.build.directory}/test-classes/kdc" compression="gzip" />
  676. <copy file="${kdc.resource.dir}/server.xml" toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/conf"/>
  677. <mkdir dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif"/>
  678. <copy toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif">
  679. <fileset dir="${kdc.resource.dir}/ldif"/>
  680. </copy>
  681. <chmod file="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/apacheds.sh" perm="775" />
  682. <exec dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/" executable="./apacheds.sh" spawn="true"/>
  683. </target>
  684. </configuration>
  685. </execution>
  686. <!-- On completion of graceful test phase: closes the ApacheDS KDC server -->
  687. <execution>
  688. <id>killKdc</id>
  689. <phase>test</phase>
  690. <goals>
  691. <goal>run</goal>
  692. </goals>
  693. <configuration>
  694. <target>
  695. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  696. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  697. </target>
  698. </configuration>
  699. </execution>
  700. </executions>
  701. </plugin>
  702. </plugins>
  703. </build>
  704. </profile>
  705. <profile>
  706. <id>parallel-tests</id>
  707. <build>
  708. <plugins>
  709. <plugin>
  710. <artifactId>maven-antrun-plugin</artifactId>
  711. <executions>
  712. <execution>
  713. <id>create-parallel-tests-dirs</id>
  714. <phase>test-compile</phase>
  715. <configuration>
  716. <target>
  717. <exec executable="sh">
  718. <arg value="-c"/>
  719. <arg value="for i in {1..${testsThreadCount}}; do mkdir -p ${test.build.data}/$i; mkdir -p ${hadoop.tmp.dir}/$i; done"/>
  720. </exec>
  721. </target>
  722. </configuration>
  723. <goals>
  724. <goal>run</goal>
  725. </goals>
  726. </execution>
  727. </executions>
  728. </plugin>
  729. <plugin>
  730. <groupId>org.apache.maven.plugins</groupId>
  731. <artifactId>maven-surefire-plugin</artifactId>
  732. <configuration>
  733. <forkCount>${testsThreadCount}</forkCount>
  734. <argLine>-Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -DminiClusterDedicatedDirs=true</argLine>
  735. <systemPropertyVariables>
  736. <test.build.data>${test.build.data}/${surefire.forkNumber}</test.build.data>
  737. <hadoop.tmp.dir>${hadoop.tmp.dir}/${surefire.forkNumber}</hadoop.tmp.dir>
  738. </systemPropertyVariables>
  739. </configuration>
  740. </plugin>
  741. </plugins>
  742. </build>
  743. </profile>
  744. </profiles>
  745. </project>