pom.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  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. <dependency>
  211. <groupId>org.mock-server</groupId>
  212. <artifactId>mockserver-netty</artifactId>
  213. <version>3.9.2</version>
  214. <scope>test</scope>
  215. </dependency>
  216. <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
  217. <dependency>
  218. <groupId>org.bouncycastle</groupId>
  219. <artifactId>bcprov-jdk16</artifactId>
  220. <scope>test</scope>
  221. </dependency>
  222. </dependencies>
  223. <build>
  224. <plugins>
  225. <plugin>
  226. <groupId>org.apache.maven.plugins</groupId>
  227. <artifactId>maven-surefire-plugin</artifactId>
  228. <configuration>
  229. <systemPropertyVariables>
  230. <startKdc>${startKdc}</startKdc>
  231. <kdc.resource.dir>${kdc.resource.dir}</kdc.resource.dir>
  232. <runningWithNative>${runningWithNative}</runningWithNative>
  233. </systemPropertyVariables>
  234. <properties>
  235. <property>
  236. <name>listener</name>
  237. <value>org.apache.hadoop.test.TimedOutTestsListener</value>
  238. </property>
  239. </properties>
  240. </configuration>
  241. </plugin>
  242. <plugin>
  243. <groupId>org.apache.maven.plugins</groupId>
  244. <artifactId>maven-antrun-plugin</artifactId>
  245. <configuration>
  246. <skipTests>false</skipTests>
  247. </configuration>
  248. <executions>
  249. <execution>
  250. <id>create-web-xmls</id>
  251. <phase>compile</phase>
  252. <goals>
  253. <goal>run</goal>
  254. </goals>
  255. <configuration>
  256. <target>
  257. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  258. tofile="${project.build.directory}/webapps/hdfs/WEB-INF/web.xml"
  259. filtering="true"/>
  260. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  261. tofile="${project.build.directory}/webapps/secondary/WEB-INF/web.xml"
  262. filtering="true"/>
  263. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  264. tofile="${project.build.directory}/webapps/datanode/WEB-INF/web.xml"
  265. filtering="true"/>
  266. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  267. tofile="${project.build.directory}/webapps/journal/WEB-INF/web.xml"
  268. filtering="true"/>
  269. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  270. tofile="${project.build.directory}/webapps/nfs3/WEB-INF/web.xml"
  271. filtering="true"/>
  272. <copy toDir="${project.build.directory}/webapps">
  273. <fileset dir="${basedir}/src/main/webapps">
  274. <exclude name="**/proto-web.xml"/>
  275. </fileset>
  276. </copy>
  277. </target>
  278. </configuration>
  279. </execution>
  280. <execution>
  281. <id>create-log-dir</id>
  282. <phase>process-test-resources</phase>
  283. <goals>
  284. <goal>run</goal>
  285. </goals>
  286. <configuration>
  287. <target>
  288. <delete dir="${test.build.data}"/>
  289. <mkdir dir="${test.build.data}"/>
  290. <mkdir dir="${hadoop.log.dir}"/>
  291. <copy todir="${project.build.directory}/test-classes/webapps">
  292. <fileset dir="${project.build.directory}/webapps">
  293. <exclude name="proto-*-web.xml"/>
  294. <exclude name="**/proto-web.xml"/>
  295. </fileset>
  296. </copy>
  297. </target>
  298. </configuration>
  299. </execution>
  300. <execution>
  301. <phase>pre-site</phase>
  302. <goals>
  303. <goal>run</goal>
  304. </goals>
  305. <configuration>
  306. <tasks>
  307. <copy file="src/main/resources/hdfs-default.xml" todir="src/site/resources"/>
  308. <copy file="src/main/xsl/configuration.xsl" todir="src/site/resources"/>
  309. </tasks>
  310. </configuration>
  311. </execution>
  312. </executions>
  313. </plugin>
  314. <plugin>
  315. <groupId>org.apache.hadoop</groupId>
  316. <artifactId>hadoop-maven-plugins</artifactId>
  317. <executions>
  318. <execution>
  319. <id>compile-protoc</id>
  320. <phase>generate-sources</phase>
  321. <goals>
  322. <goal>protoc</goal>
  323. </goals>
  324. <configuration>
  325. <protocVersion>${protobuf.version}</protocVersion>
  326. <protocCommand>${protoc.path}</protocCommand>
  327. <imports>
  328. <param>${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto</param>
  329. <param>${basedir}/../hadoop-hdfs-client/src/main/proto</param>
  330. <param>${basedir}/src/main/proto</param>
  331. </imports>
  332. <source>
  333. <directory>${basedir}/src/main/proto</directory>
  334. <includes>
  335. <include>HdfsServer.proto</include>
  336. <include>DatanodeProtocol.proto</include>
  337. <include>HAZKInfo.proto</include>
  338. <include>InterDatanodeProtocol.proto</include>
  339. <include>JournalProtocol.proto</include>
  340. <include>NamenodeProtocol.proto</include>
  341. <include>QJournalProtocol.proto</include>
  342. <include>editlog.proto</include>
  343. <include>fsimage.proto</include>
  344. </includes>
  345. </source>
  346. <output>${project.build.directory}/generated-sources/java</output>
  347. </configuration>
  348. </execution>
  349. </executions>
  350. </plugin>
  351. <plugin>
  352. <groupId>org.apache.maven.plugins</groupId>
  353. <artifactId>maven-javadoc-plugin</artifactId>
  354. <configuration>
  355. <excludePackageNames>org.apache.hadoop.hdfs.protocol.proto</excludePackageNames>
  356. </configuration>
  357. </plugin>
  358. <plugin>
  359. <groupId>org.apache.rat</groupId>
  360. <artifactId>apache-rat-plugin</artifactId>
  361. <configuration>
  362. <excludes>
  363. <exclude>CHANGES.txt</exclude>
  364. <exclude>CHANGES.HDFS-1623.txt</exclude>
  365. <exclude>CHANGES.HDFS-347.txt</exclude>
  366. <exclude>.gitattributes</exclude>
  367. <exclude>.idea/**</exclude>
  368. <exclude>src/main/conf/*</exclude>
  369. <exclude>dev-support/findbugsExcludeFile.xml</exclude>
  370. <exclude>dev-support/checkstyle*</exclude>
  371. <exclude>dev-support/jdiff/**</exclude>
  372. <exclude>dev-support/*tests</exclude>
  373. <exclude>src/test/empty-file</exclude>
  374. <exclude>src/test/all-tests</exclude>
  375. <exclude>src/test/resources/*.tgz</exclude>
  376. <exclude>src/test/resources/data*</exclude>
  377. <exclude>src/test/resources/editsStored*</exclude>
  378. <exclude>src/test/resources/empty-file</exclude>
  379. <exclude>src/test/aop/org/apache/hadoop/hdfs/server/datanode/DataXceiverAspects.aj</exclude>
  380. <exclude>src/main/webapps/datanode/robots.txt</exclude>
  381. <exclude>src/contrib/**</exclude>
  382. <exclude>src/site/resources/images/*</exclude>
  383. <exclude>src/main/webapps/static/bootstrap-3.0.2/**</exclude>
  384. <exclude>src/main/webapps/static/moment.min.js</exclude>
  385. <exclude>src/main/webapps/static/dust-full-2.0.0.min.js</exclude>
  386. <exclude>src/main/webapps/static/dust-helpers-1.1.1.min.js</exclude>
  387. <exclude>src/main/webapps/static/jquery-1.10.2.min.js</exclude>
  388. <exclude>src/main/webapps/static/jquery.dataTables.min.js</exclude>
  389. <exclude>src/main/webapps/static/dataTables.bootstrap.css</exclude>
  390. <exclude>src/main/webapps/static/dataTables.bootstrap.js</exclude>
  391. </excludes>
  392. </configuration>
  393. </plugin>
  394. <plugin>
  395. <artifactId>maven-clean-plugin</artifactId>
  396. <configuration>
  397. <filesets>
  398. <fileset>
  399. <directory>src/site/resources</directory>
  400. <includes>
  401. <include>configuration.xsl</include>
  402. <include>hdfs-default.xml</include>
  403. </includes>
  404. <followSymlinks>false</followSymlinks>
  405. </fileset>
  406. </filesets>
  407. </configuration>
  408. </plugin>
  409. </plugins>
  410. </build>
  411. <profiles>
  412. <!-- profile that starts ApacheDS KDC server -->
  413. <profile>
  414. <id>startKdc</id>
  415. <activation>
  416. <property>
  417. <name>startKdc</name>
  418. <value>true</value>
  419. </property>
  420. </activation>
  421. <build>
  422. <plugins>
  423. <plugin>
  424. <groupId>org.apache.maven.plugins</groupId>
  425. <artifactId>maven-enforcer-plugin</artifactId>
  426. <executions>
  427. <execution>
  428. <id>enforce-os</id>
  429. <goals>
  430. <goal>enforce</goal>
  431. </goals>
  432. <configuration>
  433. <rules>
  434. <!-- At present supports Mac and Unix OS family -->
  435. <requireOS>
  436. <family>mac</family>
  437. <family>unix</family>
  438. </requireOS>
  439. </rules>
  440. <fail>true</fail>
  441. </configuration>
  442. </execution>
  443. </executions>
  444. </plugin>
  445. <plugin>
  446. <groupId>org.apache.maven.plugins</groupId>
  447. <artifactId>maven-antrun-plugin</artifactId>
  448. <executions>
  449. <execution>
  450. <id>kdc</id>
  451. <phase>compile</phase>
  452. <goals>
  453. <goal>run</goal>
  454. </goals>
  455. <configuration>
  456. <target>
  457. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  458. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  459. <mkdir dir="${project.build.directory}/test-classes/kdc/downloads"/>
  460. <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"/>
  461. <untar src="${project.build.directory}/test-classes/kdc/downloads/apacheds-1.5.7.tar.gz" dest="${project.build.directory}/test-classes/kdc" compression="gzip" />
  462. <copy file="${kdc.resource.dir}/server.xml" toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/conf"/>
  463. <mkdir dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif"/>
  464. <copy toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif">
  465. <fileset dir="${kdc.resource.dir}/ldif"/>
  466. </copy>
  467. <chmod file="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/apacheds.sh" perm="775" />
  468. <exec dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/" executable="./apacheds.sh" spawn="true"/>
  469. </target>
  470. </configuration>
  471. </execution>
  472. <!-- On completion of graceful test phase: closes the ApacheDS KDC server -->
  473. <execution>
  474. <id>killKdc</id>
  475. <phase>test</phase>
  476. <goals>
  477. <goal>run</goal>
  478. </goals>
  479. <configuration>
  480. <target>
  481. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  482. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  483. </target>
  484. </configuration>
  485. </execution>
  486. </executions>
  487. </plugin>
  488. </plugins>
  489. </build>
  490. </profile>
  491. <profile>
  492. <id>parallel-tests</id>
  493. <build>
  494. <plugins>
  495. <plugin>
  496. <artifactId>maven-antrun-plugin</artifactId>
  497. <executions>
  498. <execution>
  499. <id>create-parallel-tests-dirs</id>
  500. <phase>test-compile</phase>
  501. <configuration>
  502. <target>
  503. <exec executable="${shell-executable}">
  504. <arg value="-c"/>
  505. <arg value="for i in {1..${testsThreadCount}}; do mkdir -p ${test.build.data}/$i; mkdir -p ${hadoop.tmp.dir}/$i; done"/>
  506. </exec>
  507. </target>
  508. </configuration>
  509. <goals>
  510. <goal>run</goal>
  511. </goals>
  512. </execution>
  513. </executions>
  514. </plugin>
  515. <plugin>
  516. <groupId>org.apache.maven.plugins</groupId>
  517. <artifactId>maven-surefire-plugin</artifactId>
  518. <configuration>
  519. <forkCount>${testsThreadCount}</forkCount>
  520. <argLine>-Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -DminiClusterDedicatedDirs=true</argLine>
  521. <systemPropertyVariables>
  522. <test.build.data>${test.build.data}/${surefire.forkNumber}</test.build.data>
  523. <hadoop.tmp.dir>${hadoop.tmp.dir}/${surefire.forkNumber}</hadoop.tmp.dir>
  524. </systemPropertyVariables>
  525. </configuration>
  526. </plugin>
  527. </plugins>
  528. </build>
  529. </profile>
  530. </profiles>
  531. </project>