pom.xml 18 KB

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