pom.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  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.8.1</version>
  22. <relativePath>../../hadoop-project-dist</relativePath>
  23. </parent>
  24. <groupId>org.apache.hadoop</groupId>
  25. <artifactId>hadoop-hdfs</artifactId>
  26. <version>2.8.1</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. </dependencies>
  216. <build>
  217. <plugins>
  218. <plugin>
  219. <groupId>org.apache.maven.plugins</groupId>
  220. <artifactId>maven-surefire-plugin</artifactId>
  221. <configuration>
  222. <systemPropertyVariables>
  223. <startKdc>${startKdc}</startKdc>
  224. <kdc.resource.dir>${kdc.resource.dir}</kdc.resource.dir>
  225. <runningWithNative>${runningWithNative}</runningWithNative>
  226. </systemPropertyVariables>
  227. <properties>
  228. <property>
  229. <name>listener</name>
  230. <value>org.apache.hadoop.test.TimedOutTestsListener</value>
  231. </property>
  232. </properties>
  233. </configuration>
  234. </plugin>
  235. <plugin>
  236. <groupId>org.apache.maven.plugins</groupId>
  237. <artifactId>maven-antrun-plugin</artifactId>
  238. <configuration>
  239. <skipTests>false</skipTests>
  240. </configuration>
  241. <executions>
  242. <execution>
  243. <id>create-web-xmls</id>
  244. <phase>compile</phase>
  245. <goals>
  246. <goal>run</goal>
  247. </goals>
  248. <configuration>
  249. <target>
  250. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  251. tofile="${project.build.directory}/webapps/hdfs/WEB-INF/web.xml"
  252. filtering="true"/>
  253. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  254. tofile="${project.build.directory}/webapps/secondary/WEB-INF/web.xml"
  255. filtering="true"/>
  256. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  257. tofile="${project.build.directory}/webapps/datanode/WEB-INF/web.xml"
  258. filtering="true"/>
  259. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  260. tofile="${project.build.directory}/webapps/journal/WEB-INF/web.xml"
  261. filtering="true"/>
  262. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  263. tofile="${project.build.directory}/webapps/nfs3/WEB-INF/web.xml"
  264. filtering="true"/>
  265. <copy toDir="${project.build.directory}/webapps">
  266. <fileset dir="${basedir}/src/main/webapps">
  267. <exclude name="**/proto-web.xml"/>
  268. </fileset>
  269. </copy>
  270. <replace dir="${project.build.directory}/webapps" value="${release-year}">
  271. <include name="**/*.html"/>
  272. <replacetoken>{release-year-token}</replacetoken>
  273. </replace>
  274. </target>
  275. </configuration>
  276. </execution>
  277. <execution>
  278. <id>create-log-dir</id>
  279. <phase>process-test-resources</phase>
  280. <goals>
  281. <goal>run</goal>
  282. </goals>
  283. <configuration>
  284. <target>
  285. <delete dir="${test.build.data}"/>
  286. <mkdir dir="${test.build.data}"/>
  287. <mkdir dir="${hadoop.log.dir}"/>
  288. <copy todir="${project.build.directory}/test-classes/webapps">
  289. <fileset dir="${project.build.directory}/webapps">
  290. <exclude name="proto-*-web.xml"/>
  291. <exclude name="**/proto-web.xml"/>
  292. </fileset>
  293. </copy>
  294. </target>
  295. </configuration>
  296. </execution>
  297. <execution>
  298. <phase>pre-site</phase>
  299. <goals>
  300. <goal>run</goal>
  301. </goals>
  302. <configuration>
  303. <tasks>
  304. <copy file="src/main/resources/hdfs-default.xml" todir="src/site/resources"/>
  305. <copy file="src/main/xsl/configuration.xsl" todir="src/site/resources"/>
  306. </tasks>
  307. </configuration>
  308. </execution>
  309. </executions>
  310. </plugin>
  311. <plugin>
  312. <groupId>org.apache.hadoop</groupId>
  313. <artifactId>hadoop-maven-plugins</artifactId>
  314. <executions>
  315. <execution>
  316. <id>compile-protoc</id>
  317. <phase>generate-sources</phase>
  318. <goals>
  319. <goal>protoc</goal>
  320. </goals>
  321. <configuration>
  322. <protocVersion>${protobuf.version}</protocVersion>
  323. <protocCommand>${protoc.path}</protocCommand>
  324. <imports>
  325. <param>${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto</param>
  326. <param>${basedir}/../hadoop-hdfs-client/src/main/proto</param>
  327. <param>${basedir}/src/main/proto</param>
  328. </imports>
  329. <source>
  330. <directory>${basedir}/src/main/proto</directory>
  331. <includes>
  332. <include>HdfsServer.proto</include>
  333. <include>DatanodeProtocol.proto</include>
  334. <include>DatanodeLifelineProtocol.proto</include>
  335. <include>HAZKInfo.proto</include>
  336. <include>InterDatanodeProtocol.proto</include>
  337. <include>JournalProtocol.proto</include>
  338. <include>NamenodeProtocol.proto</include>
  339. <include>QJournalProtocol.proto</include>
  340. <include>editlog.proto</include>
  341. <include>fsimage.proto</include>
  342. </includes>
  343. </source>
  344. <output>${project.build.directory}/generated-sources/java</output>
  345. </configuration>
  346. </execution>
  347. </executions>
  348. </plugin>
  349. <plugin>
  350. <groupId>org.apache.maven.plugins</groupId>
  351. <artifactId>maven-javadoc-plugin</artifactId>
  352. <configuration>
  353. <excludePackageNames>org.apache.hadoop.hdfs.protocol.proto</excludePackageNames>
  354. </configuration>
  355. </plugin>
  356. <plugin>
  357. <groupId>org.apache.rat</groupId>
  358. <artifactId>apache-rat-plugin</artifactId>
  359. <configuration>
  360. <excludes>
  361. <exclude>.gitattributes</exclude>
  362. <exclude>.idea/**</exclude>
  363. <exclude>src/main/conf/*</exclude>
  364. <exclude>dev-support/findbugsExcludeFile.xml</exclude>
  365. <exclude>dev-support/checkstyle*</exclude>
  366. <exclude>dev-support/jdiff/**</exclude>
  367. <exclude>dev-support/*tests</exclude>
  368. <exclude>src/test/empty-file</exclude>
  369. <exclude>src/test/all-tests</exclude>
  370. <exclude>src/test/resources/*.tgz</exclude>
  371. <exclude>src/test/resources/data*</exclude>
  372. <exclude>**/*.json</exclude>
  373. <exclude>src/test/resources/editsStored*</exclude>
  374. <exclude>src/test/resources/empty-file</exclude>
  375. <exclude>src/main/webapps/datanode/robots.txt</exclude>
  376. <exclude>src/contrib/**</exclude>
  377. <exclude>src/site/resources/images/*</exclude>
  378. <exclude>src/main/webapps/static/bootstrap-3.0.2/**</exclude>
  379. <exclude>src/main/webapps/static/moment.min.js</exclude>
  380. <exclude>src/main/webapps/static/dust-full-2.0.0.min.js</exclude>
  381. <exclude>src/main/webapps/static/dust-helpers-1.1.1.min.js</exclude>
  382. <exclude>src/main/webapps/static/jquery-1.10.2.min.js</exclude>
  383. <exclude>src/main/webapps/static/jquery.dataTables.min.js</exclude>
  384. <exclude>src/main/webapps/static/json-bignum.js</exclude>
  385. <exclude>src/main/webapps/static/dataTables.bootstrap.css</exclude>
  386. <exclude>src/main/webapps/static/dataTables.bootstrap.js</exclude>
  387. </excludes>
  388. </configuration>
  389. </plugin>
  390. <plugin>
  391. <artifactId>maven-clean-plugin</artifactId>
  392. <configuration>
  393. <filesets>
  394. <fileset>
  395. <directory>src/site/resources</directory>
  396. <includes>
  397. <include>configuration.xsl</include>
  398. <include>hdfs-default.xml</include>
  399. </includes>
  400. <followSymlinks>false</followSymlinks>
  401. </fileset>
  402. </filesets>
  403. </configuration>
  404. </plugin>
  405. </plugins>
  406. </build>
  407. <profiles>
  408. <profile>
  409. <id>parallel-tests</id>
  410. <build>
  411. <plugins>
  412. <plugin>
  413. <artifactId>maven-antrun-plugin</artifactId>
  414. <executions>
  415. <execution>
  416. <id>create-parallel-tests-dirs</id>
  417. <phase>test-compile</phase>
  418. <configuration>
  419. <target>
  420. <script language="javascript"><![CDATA[
  421. var baseDirs = [
  422. "${test.build.data}",
  423. "${test.build.dir}",
  424. "${hadoop.tmp.dir}" ];
  425. for (var i in baseDirs) {
  426. for (var j = 1; j <= ${testsThreadCount}; ++j) {
  427. var mkdir = project.createTask("mkdir");
  428. mkdir.setDir(new java.io.File(baseDirs[i], j));
  429. mkdir.perform();
  430. }
  431. }
  432. ]]></script>
  433. </target>
  434. </configuration>
  435. <goals>
  436. <goal>run</goal>
  437. </goals>
  438. </execution>
  439. </executions>
  440. </plugin>
  441. <plugin>
  442. <groupId>org.apache.maven.plugins</groupId>
  443. <artifactId>maven-surefire-plugin</artifactId>
  444. <configuration>
  445. <forkCount>${testsThreadCount}</forkCount>
  446. <reuseForks>false</reuseForks>
  447. <argLine>${maven-surefire-plugin.argLine} -DminiClusterDedicatedDirs=true</argLine>
  448. <systemPropertyVariables>
  449. <test.build.data>${test.build.data}/${surefire.forkNumber}</test.build.data>
  450. <test.build.dir>${test.build.dir}/${surefire.forkNumber}</test.build.dir>
  451. <hadoop.tmp.dir>${hadoop.tmp.dir}/${surefire.forkNumber}</hadoop.tmp.dir>
  452. <!-- This is intentionally the same directory for all JUnit -->
  453. <!-- forks, for use in the very rare situation that -->
  454. <!-- concurrent tests need to coordinate, such as using lock -->
  455. <!-- files. -->
  456. <test.build.shared.data>${test.build.data}</test.build.shared.data>
  457. <!-- Due to a Maven quirk, setting this to just -->
  458. <!-- surefire.forkNumber won't do the parameter substitution. -->
  459. <!-- Putting a prefix in front of it like "fork-" makes it -->
  460. <!-- work. -->
  461. <test.unique.fork.id>fork-${surefire.forkNumber}</test.unique.fork.id>
  462. </systemPropertyVariables>
  463. </configuration>
  464. </plugin>
  465. </plugins>
  466. </build>
  467. </profile>
  468. </profiles>
  469. </project>