pom.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  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. </properties>
  35. <dependencies>
  36. <dependency>
  37. <groupId>org.apache.hadoop</groupId>
  38. <artifactId>hadoop-annotations</artifactId>
  39. <scope>provided</scope>
  40. </dependency>
  41. <dependency>
  42. <groupId>org.apache.hadoop</groupId>
  43. <artifactId>hadoop-auth</artifactId>
  44. <scope>provided</scope>
  45. </dependency>
  46. <dependency>
  47. <groupId>org.apache.hadoop</groupId>
  48. <artifactId>hadoop-common</artifactId>
  49. <scope>provided</scope>
  50. </dependency>
  51. <dependency>
  52. <groupId>org.apache.hadoop</groupId>
  53. <artifactId>hadoop-common</artifactId>
  54. <scope>test</scope>
  55. <type>test-jar</type>
  56. </dependency>
  57. <dependency>
  58. <groupId>org.apache.hadoop</groupId>
  59. <artifactId>hadoop-hdfs-client</artifactId>
  60. <scope>compile</scope>
  61. </dependency>
  62. <dependency>
  63. <groupId>org.apache.zookeeper</groupId>
  64. <artifactId>zookeeper</artifactId>
  65. <type>test-jar</type>
  66. <scope>test</scope>
  67. </dependency>
  68. <dependency>
  69. <groupId>com.google.guava</groupId>
  70. <artifactId>guava</artifactId>
  71. <scope>compile</scope>
  72. </dependency>
  73. <dependency>
  74. <groupId>org.mortbay.jetty</groupId>
  75. <artifactId>jetty</artifactId>
  76. <scope>compile</scope>
  77. </dependency>
  78. <dependency>
  79. <groupId>org.mortbay.jetty</groupId>
  80. <artifactId>jetty-util</artifactId>
  81. <scope>compile</scope>
  82. </dependency>
  83. <dependency>
  84. <groupId>com.sun.jersey</groupId>
  85. <artifactId>jersey-core</artifactId>
  86. <scope>compile</scope>
  87. </dependency>
  88. <dependency>
  89. <groupId>com.sun.jersey</groupId>
  90. <artifactId>jersey-server</artifactId>
  91. <scope>compile</scope>
  92. </dependency>
  93. <dependency>
  94. <groupId>commons-cli</groupId>
  95. <artifactId>commons-cli</artifactId>
  96. <scope>compile</scope>
  97. </dependency>
  98. <dependency>
  99. <groupId>commons-codec</groupId>
  100. <artifactId>commons-codec</artifactId>
  101. <scope>compile</scope>
  102. </dependency>
  103. <dependency>
  104. <groupId>commons-io</groupId>
  105. <artifactId>commons-io</artifactId>
  106. <scope>compile</scope>
  107. </dependency>
  108. <dependency>
  109. <groupId>commons-lang</groupId>
  110. <artifactId>commons-lang</artifactId>
  111. <scope>compile</scope>
  112. </dependency>
  113. <dependency>
  114. <groupId>commons-logging</groupId>
  115. <artifactId>commons-logging</artifactId>
  116. <scope>compile</scope>
  117. </dependency>
  118. <dependency>
  119. <groupId>commons-daemon</groupId>
  120. <artifactId>commons-daemon</artifactId>
  121. <scope>compile</scope>
  122. </dependency>
  123. <dependency>
  124. <groupId>log4j</groupId>
  125. <artifactId>log4j</artifactId>
  126. <scope>compile</scope>
  127. </dependency>
  128. <dependency>
  129. <groupId>com.google.protobuf</groupId>
  130. <artifactId>protobuf-java</artifactId>
  131. <scope>compile</scope>
  132. </dependency>
  133. <dependency>
  134. <groupId>javax.servlet</groupId>
  135. <artifactId>servlet-api</artifactId>
  136. <scope>compile</scope>
  137. </dependency>
  138. <dependency>
  139. <groupId>junit</groupId>
  140. <artifactId>junit</artifactId>
  141. <scope>test</scope>
  142. </dependency>
  143. <dependency>
  144. <groupId>org.apache.hadoop</groupId>
  145. <artifactId>hadoop-minikdc</artifactId>
  146. <scope>test</scope>
  147. </dependency>
  148. <dependency>
  149. <groupId>org.mockito</groupId>
  150. <artifactId>mockito-all</artifactId>
  151. <scope>test</scope>
  152. </dependency>
  153. <dependency>
  154. <groupId>org.slf4j</groupId>
  155. <artifactId>slf4j-log4j12</artifactId>
  156. <scope>provided</scope>
  157. </dependency>
  158. <dependency>
  159. <groupId>org.codehaus.jackson</groupId>
  160. <artifactId>jackson-core-asl</artifactId>
  161. <scope>compile</scope>
  162. </dependency>
  163. <dependency>
  164. <groupId>org.codehaus.jackson</groupId>
  165. <artifactId>jackson-mapper-asl</artifactId>
  166. <scope>compile</scope>
  167. </dependency>
  168. <dependency>
  169. <groupId>xmlenc</groupId>
  170. <artifactId>xmlenc</artifactId>
  171. <scope>compile</scope>
  172. </dependency>
  173. <dependency>
  174. <groupId>io.netty</groupId>
  175. <artifactId>netty-all</artifactId>
  176. <scope>compile</scope>
  177. </dependency>
  178. <dependency>
  179. <groupId>com.twitter</groupId>
  180. <artifactId>hpack</artifactId>
  181. <scope>compile</scope>
  182. </dependency>
  183. <dependency>
  184. <groupId>xerces</groupId>
  185. <artifactId>xercesImpl</artifactId>
  186. <scope>compile</scope>
  187. </dependency>
  188. <dependency>
  189. <groupId>org.apache.htrace</groupId>
  190. <artifactId>htrace-core4</artifactId>
  191. </dependency>
  192. <dependency>
  193. <groupId>org.apache.hadoop</groupId>
  194. <artifactId>hadoop-kms</artifactId>
  195. <classifier>classes</classifier>
  196. <type>jar</type>
  197. <scope>test</scope>
  198. </dependency>
  199. <dependency>
  200. <groupId>org.apache.hadoop</groupId>
  201. <artifactId>hadoop-kms</artifactId>
  202. <type>test-jar</type>
  203. <scope>test</scope>
  204. </dependency>
  205. <dependency>
  206. <groupId>org.fusesource.leveldbjni</groupId>
  207. <artifactId>leveldbjni-all</artifactId>
  208. <version>1.8</version>
  209. </dependency>
  210. <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
  211. <dependency>
  212. <groupId>org.bouncycastle</groupId>
  213. <artifactId>bcprov-jdk16</artifactId>
  214. <scope>test</scope>
  215. </dependency>
  216. </dependencies>
  217. <build>
  218. <plugins>
  219. <plugin>
  220. <groupId>org.apache.maven.plugins</groupId>
  221. <artifactId>maven-surefire-plugin</artifactId>
  222. <configuration>
  223. <systemPropertyVariables>
  224. <startKdc>${startKdc}</startKdc>
  225. <kdc.resource.dir>${kdc.resource.dir}</kdc.resource.dir>
  226. <runningWithNative>${runningWithNative}</runningWithNative>
  227. </systemPropertyVariables>
  228. <properties>
  229. <property>
  230. <name>listener</name>
  231. <value>org.apache.hadoop.test.TimedOutTestsListener</value>
  232. </property>
  233. </properties>
  234. </configuration>
  235. </plugin>
  236. <plugin>
  237. <groupId>org.apache.maven.plugins</groupId>
  238. <artifactId>maven-antrun-plugin</artifactId>
  239. <configuration>
  240. <skipTests>false</skipTests>
  241. </configuration>
  242. <executions>
  243. <execution>
  244. <id>create-web-xmls</id>
  245. <phase>compile</phase>
  246. <goals>
  247. <goal>run</goal>
  248. </goals>
  249. <configuration>
  250. <target>
  251. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  252. tofile="${project.build.directory}/webapps/hdfs/WEB-INF/web.xml"
  253. filtering="true"/>
  254. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  255. tofile="${project.build.directory}/webapps/secondary/WEB-INF/web.xml"
  256. filtering="true"/>
  257. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  258. tofile="${project.build.directory}/webapps/datanode/WEB-INF/web.xml"
  259. filtering="true"/>
  260. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  261. tofile="${project.build.directory}/webapps/journal/WEB-INF/web.xml"
  262. filtering="true"/>
  263. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  264. tofile="${project.build.directory}/webapps/nfs3/WEB-INF/web.xml"
  265. filtering="true"/>
  266. <copy toDir="${project.build.directory}/webapps">
  267. <fileset dir="${basedir}/src/main/webapps">
  268. <exclude name="**/proto-web.xml"/>
  269. </fileset>
  270. </copy>
  271. </target>
  272. </configuration>
  273. </execution>
  274. <execution>
  275. <id>create-log-dir</id>
  276. <phase>process-test-resources</phase>
  277. <goals>
  278. <goal>run</goal>
  279. </goals>
  280. <configuration>
  281. <target>
  282. <delete dir="${test.build.data}"/>
  283. <mkdir dir="${test.build.data}"/>
  284. <mkdir dir="${hadoop.log.dir}"/>
  285. <copy todir="${project.build.directory}/test-classes/webapps">
  286. <fileset dir="${project.build.directory}/webapps">
  287. <exclude name="proto-*-web.xml"/>
  288. <exclude name="**/proto-web.xml"/>
  289. </fileset>
  290. </copy>
  291. </target>
  292. </configuration>
  293. </execution>
  294. <execution>
  295. <phase>pre-site</phase>
  296. <goals>
  297. <goal>run</goal>
  298. </goals>
  299. <configuration>
  300. <tasks>
  301. <copy file="src/main/resources/hdfs-default.xml" todir="src/site/resources"/>
  302. <copy file="src/main/xsl/configuration.xsl" todir="src/site/resources"/>
  303. </tasks>
  304. </configuration>
  305. </execution>
  306. </executions>
  307. </plugin>
  308. <plugin>
  309. <groupId>org.apache.hadoop</groupId>
  310. <artifactId>hadoop-maven-plugins</artifactId>
  311. <executions>
  312. <execution>
  313. <id>compile-protoc</id>
  314. <phase>generate-sources</phase>
  315. <goals>
  316. <goal>protoc</goal>
  317. </goals>
  318. <configuration>
  319. <protocVersion>${protobuf.version}</protocVersion>
  320. <protocCommand>${protoc.path}</protocCommand>
  321. <imports>
  322. <param>${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto</param>
  323. <param>${basedir}/../hadoop-hdfs-client/src/main/proto</param>
  324. <param>${basedir}/src/main/proto</param>
  325. </imports>
  326. <source>
  327. <directory>${basedir}/src/main/proto</directory>
  328. <includes>
  329. <include>HdfsServer.proto</include>
  330. <include>DatanodeProtocol.proto</include>
  331. <include>HAZKInfo.proto</include>
  332. <include>InterDatanodeProtocol.proto</include>
  333. <include>JournalProtocol.proto</include>
  334. <include>NamenodeProtocol.proto</include>
  335. <include>QJournalProtocol.proto</include>
  336. <include>editlog.proto</include>
  337. <include>fsimage.proto</include>
  338. </includes>
  339. </source>
  340. <output>${project.build.directory}/generated-sources/java</output>
  341. </configuration>
  342. </execution>
  343. </executions>
  344. </plugin>
  345. <plugin>
  346. <groupId>org.apache.maven.plugins</groupId>
  347. <artifactId>maven-javadoc-plugin</artifactId>
  348. <configuration>
  349. <excludePackageNames>org.apache.hadoop.hdfs.protocol.proto</excludePackageNames>
  350. </configuration>
  351. </plugin>
  352. <plugin>
  353. <groupId>org.apache.rat</groupId>
  354. <artifactId>apache-rat-plugin</artifactId>
  355. <configuration>
  356. <excludes>
  357. <exclude>CHANGES.txt</exclude>
  358. <exclude>CHANGES.HDFS-1623.txt</exclude>
  359. <exclude>CHANGES.HDFS-347.txt</exclude>
  360. <exclude>.gitattributes</exclude>
  361. <exclude>.idea/**</exclude>
  362. <exclude>src/main/conf/*</exclude>
  363. <exclude>dev-support/findbugsExcludeFile.xml</exclude>
  364. <exclude>dev-support/checkstyle*</exclude>
  365. <exclude>dev-support/jdiff/**</exclude>
  366. <exclude>dev-support/*tests</exclude>
  367. <exclude>src/test/empty-file</exclude>
  368. <exclude>src/test/all-tests</exclude>
  369. <exclude>src/test/resources/*.tgz</exclude>
  370. <exclude>src/test/resources/data*</exclude>
  371. <exclude>src/test/resources/editsStored*</exclude>
  372. <exclude>src/test/resources/empty-file</exclude>
  373. <exclude>src/test/aop/org/apache/hadoop/hdfs/server/datanode/DataXceiverAspects.aj</exclude>
  374. <exclude>src/main/webapps/datanode/robots.txt</exclude>
  375. <exclude>src/contrib/**</exclude>
  376. <exclude>src/site/resources/images/*</exclude>
  377. <exclude>src/main/webapps/static/bootstrap-3.0.2/**</exclude>
  378. <exclude>src/main/webapps/static/moment.min.js</exclude>
  379. <exclude>src/main/webapps/static/dust-full-2.0.0.min.js</exclude>
  380. <exclude>src/main/webapps/static/dust-helpers-1.1.1.min.js</exclude>
  381. <exclude>src/main/webapps/static/jquery-1.10.2.min.js</exclude>
  382. <exclude>src/main/webapps/static/jquery.dataTables.min.js</exclude>
  383. <exclude>src/main/webapps/static/json-bignum.js</exclude>
  384. <exclude>src/main/webapps/static/dataTables.bootstrap.css</exclude>
  385. <exclude>src/main/webapps/static/dataTables.bootstrap.js</exclude>
  386. </excludes>
  387. </configuration>
  388. </plugin>
  389. <plugin>
  390. <artifactId>maven-clean-plugin</artifactId>
  391. <configuration>
  392. <filesets>
  393. <fileset>
  394. <directory>src/site/resources</directory>
  395. <includes>
  396. <include>configuration.xsl</include>
  397. <include>hdfs-default.xml</include>
  398. </includes>
  399. <followSymlinks>false</followSymlinks>
  400. </fileset>
  401. </filesets>
  402. </configuration>
  403. </plugin>
  404. </plugins>
  405. </build>
  406. <profiles>
  407. <!-- profile that starts ApacheDS KDC server -->
  408. <profile>
  409. <id>startKdc</id>
  410. <activation>
  411. <property>
  412. <name>startKdc</name>
  413. <value>true</value>
  414. </property>
  415. </activation>
  416. <build>
  417. <plugins>
  418. <plugin>
  419. <groupId>org.apache.maven.plugins</groupId>
  420. <artifactId>maven-enforcer-plugin</artifactId>
  421. <executions>
  422. <execution>
  423. <id>enforce-os</id>
  424. <goals>
  425. <goal>enforce</goal>
  426. </goals>
  427. <configuration>
  428. <rules>
  429. <!-- At present supports Mac and Unix OS family -->
  430. <requireOS>
  431. <family>mac</family>
  432. <family>unix</family>
  433. </requireOS>
  434. </rules>
  435. <fail>true</fail>
  436. </configuration>
  437. </execution>
  438. </executions>
  439. </plugin>
  440. <plugin>
  441. <groupId>org.apache.maven.plugins</groupId>
  442. <artifactId>maven-antrun-plugin</artifactId>
  443. <executions>
  444. <execution>
  445. <id>kdc</id>
  446. <phase>compile</phase>
  447. <goals>
  448. <goal>run</goal>
  449. </goals>
  450. <configuration>
  451. <target>
  452. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  453. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  454. <mkdir dir="${project.build.directory}/test-classes/kdc/downloads"/>
  455. <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"/>
  456. <untar src="${project.build.directory}/test-classes/kdc/downloads/apacheds-1.5.7.tar.gz" dest="${project.build.directory}/test-classes/kdc" compression="gzip" />
  457. <copy file="${kdc.resource.dir}/server.xml" toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/conf"/>
  458. <mkdir dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif"/>
  459. <copy toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif">
  460. <fileset dir="${kdc.resource.dir}/ldif"/>
  461. </copy>
  462. <chmod file="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/apacheds.sh" perm="775" />
  463. <exec dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/" executable="./apacheds.sh" spawn="true"/>
  464. </target>
  465. </configuration>
  466. </execution>
  467. <!-- On completion of graceful test phase: closes the ApacheDS KDC server -->
  468. <execution>
  469. <id>killKdc</id>
  470. <phase>test</phase>
  471. <goals>
  472. <goal>run</goal>
  473. </goals>
  474. <configuration>
  475. <target>
  476. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  477. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  478. </target>
  479. </configuration>
  480. </execution>
  481. </executions>
  482. </plugin>
  483. </plugins>
  484. </build>
  485. </profile>
  486. <profile>
  487. <id>parallel-tests</id>
  488. <build>
  489. <plugins>
  490. <plugin>
  491. <artifactId>maven-antrun-plugin</artifactId>
  492. <executions>
  493. <execution>
  494. <id>create-parallel-tests-dirs</id>
  495. <phase>test-compile</phase>
  496. <configuration>
  497. <target>
  498. <script language="javascript"><![CDATA[
  499. var baseDirs = [
  500. "${test.build.data}",
  501. "${test.build.dir}",
  502. "${hadoop.tmp.dir}" ];
  503. for (var i in baseDirs) {
  504. for (var j = 1; j <= ${testsThreadCount}; ++j) {
  505. var mkdir = project.createTask("mkdir");
  506. mkdir.setDir(new java.io.File(baseDirs[i], j));
  507. mkdir.perform();
  508. }
  509. }
  510. ]]></script>
  511. </target>
  512. </configuration>
  513. <goals>
  514. <goal>run</goal>
  515. </goals>
  516. </execution>
  517. </executions>
  518. </plugin>
  519. <plugin>
  520. <groupId>org.apache.maven.plugins</groupId>
  521. <artifactId>maven-surefire-plugin</artifactId>
  522. <configuration>
  523. <forkCount>${testsThreadCount}</forkCount>
  524. <reuseForks>false</reuseForks>
  525. <argLine>${maven-surefire-plugin.argLine} -DminiClusterDedicatedDirs=true</argLine>
  526. <systemPropertyVariables>
  527. <test.build.data>${test.build.data}/${surefire.forkNumber}</test.build.data>
  528. <test.build.dir>${test.build.dir}/${surefire.forkNumber}</test.build.dir>
  529. <hadoop.tmp.dir>${hadoop.tmp.dir}/${surefire.forkNumber}</hadoop.tmp.dir>
  530. <!-- This is intentionally the same directory for all JUnit -->
  531. <!-- forks, for use in the very rare situation that -->
  532. <!-- concurrent tests need to coordinate, such as using lock -->
  533. <!-- files. -->
  534. <test.build.shared.data>${test.build.data}</test.build.shared.data>
  535. <!-- Due to a Maven quirk, setting this to just -->
  536. <!-- surefire.forkNumber won't do the parameter substitution. -->
  537. <!-- Putting a prefix in front of it like "fork-" makes it -->
  538. <!-- work. -->
  539. <test.unique.fork.id>fork-${surefire.forkNumber}</test.unique.fork.id>
  540. </systemPropertyVariables>
  541. </configuration>
  542. </plugin>
  543. </plugins>
  544. </build>
  545. </profile>
  546. </profiles>
  547. </project>