pom.xml 19 KB

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