pom.xml 19 KB

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