pom.xml 21 KB

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