pom.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  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>org.apache.curator</groupId>
  218. <artifactId>curator-test</artifactId>
  219. <scope>test</scope>
  220. </dependency>
  221. <dependency>
  222. <groupId>org.assertj</groupId>
  223. <artifactId>assertj-core</artifactId>
  224. <scope>test</scope>
  225. </dependency>
  226. <dependency>
  227. <groupId>org.lz4</groupId>
  228. <artifactId>lz4-java</artifactId>
  229. <scope>test</scope>
  230. </dependency>
  231. <dependency>
  232. <groupId>org.apache.hadoop</groupId>
  233. <artifactId>hadoop-annotations</artifactId>
  234. </dependency>
  235. </dependencies>
  236. <build>
  237. <plugins>
  238. <plugin>
  239. <groupId>org.apache.maven.plugins</groupId>
  240. <artifactId>maven-surefire-plugin</artifactId>
  241. <configuration>
  242. <systemPropertyVariables>
  243. <runningWithNative>${runningWithNative}</runningWithNative>
  244. </systemPropertyVariables>
  245. <properties>
  246. <property>
  247. <name>listener</name>
  248. <value>org.apache.hadoop.test.TimedOutTestsListener</value>
  249. </property>
  250. </properties>
  251. </configuration>
  252. </plugin>
  253. <plugin>
  254. <groupId>org.apache.maven.plugins</groupId>
  255. <artifactId>maven-antrun-plugin</artifactId>
  256. <configuration>
  257. <skipTests>false</skipTests>
  258. </configuration>
  259. <executions>
  260. <execution>
  261. <id>create-web-xmls</id>
  262. <phase>compile</phase>
  263. <goals>
  264. <goal>run</goal>
  265. </goals>
  266. <configuration>
  267. <target>
  268. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  269. tofile="${project.build.directory}/webapps/hdfs/WEB-INF/web.xml"
  270. filtering="true"/>
  271. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  272. tofile="${project.build.directory}/webapps/secondary/WEB-INF/web.xml"
  273. filtering="true"/>
  274. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  275. tofile="${project.build.directory}/webapps/datanode/WEB-INF/web.xml"
  276. filtering="true"/>
  277. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  278. tofile="${project.build.directory}/webapps/journal/WEB-INF/web.xml"
  279. filtering="true"/>
  280. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  281. tofile="${project.build.directory}/webapps/balancer/WEB-INF/web.xml"
  282. filtering="true"/>
  283. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  284. tofile="${project.build.directory}/webapps/nfs3/WEB-INF/web.xml"
  285. filtering="true"/>
  286. <copy toDir="${project.build.directory}/webapps">
  287. <fileset dir="${basedir}/src/main/webapps">
  288. <exclude name="**/proto-web.xml"/>
  289. </fileset>
  290. </copy>
  291. <replace dir="${project.build.directory}/webapps" value="${release-year}">
  292. <include name="**/*.html"/>
  293. <replacetoken>{release-year-token}</replacetoken>
  294. </replace>
  295. </target>
  296. </configuration>
  297. </execution>
  298. <execution>
  299. <id>create-log-dir</id>
  300. <phase>process-test-resources</phase>
  301. <goals>
  302. <goal>run</goal>
  303. </goals>
  304. <configuration>
  305. <target>
  306. <delete dir="${test.build.data}"/>
  307. <mkdir dir="${test.build.data}"/>
  308. <mkdir dir="${hadoop.log.dir}"/>
  309. <copy todir="${project.build.directory}/test-classes/webapps">
  310. <fileset dir="${project.build.directory}/webapps">
  311. <exclude name="proto-*-web.xml"/>
  312. <exclude name="**/proto-web.xml"/>
  313. </fileset>
  314. </copy>
  315. </target>
  316. </configuration>
  317. </execution>
  318. <execution>
  319. <phase>pre-site</phase>
  320. <goals>
  321. <goal>run</goal>
  322. </goals>
  323. <configuration>
  324. <target>
  325. <copy file="src/main/resources/hdfs-default.xml" todir="src/site/resources"/>
  326. <copy file="src/main/xsl/configuration.xsl" todir="src/site/resources"/>
  327. </target>
  328. </configuration>
  329. </execution>
  330. </executions>
  331. </plugin>
  332. <plugin>
  333. <groupId>org.xolstice.maven.plugins</groupId>
  334. <artifactId>protobuf-maven-plugin</artifactId>
  335. <executions>
  336. <execution>
  337. <id>src-compile-protoc</id>
  338. <configuration>
  339. <skip>false</skip>
  340. <additionalProtoPathElements>
  341. <additionalProtoPathElement>
  342. ${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto
  343. </additionalProtoPathElement>
  344. <additionalProtoPathElement>
  345. ${basedir}/../hadoop-hdfs-client/src/main/proto
  346. </additionalProtoPathElement>
  347. </additionalProtoPathElements>
  348. </configuration>
  349. </execution>
  350. </executions>
  351. </plugin>
  352. <plugin>
  353. <groupId>com.google.code.maven-replacer-plugin</groupId>
  354. <artifactId>replacer</artifactId>
  355. <executions>
  356. <execution>
  357. <id>replace-generated-sources</id>
  358. <configuration>
  359. <skip>false</skip>
  360. </configuration>
  361. </execution>
  362. <execution>
  363. <id>replace-sources</id>
  364. <configuration>
  365. <skip>false</skip>
  366. <excludes>
  367. <exclude>**/DFSUtil.java</exclude>
  368. </excludes>
  369. </configuration>
  370. </execution>
  371. <execution>
  372. <id>replace-test-sources</id>
  373. <configuration>
  374. <skip>false</skip>
  375. </configuration>
  376. </execution>
  377. </executions>
  378. </plugin>
  379. <plugin>
  380. <groupId>org.apache.hadoop</groupId>
  381. <artifactId>hadoop-maven-plugins</artifactId>
  382. <executions>
  383. <execution>
  384. <id>resource-gz</id>
  385. <phase>generate-resources</phase>
  386. <goals>
  387. <goal>resource-gz</goal>
  388. </goals>
  389. <configuration>
  390. <inputDirectory>${basedir}/src/main/webapps/static</inputDirectory>
  391. <outputDirectory>${basedir}/target/webapps/static</outputDirectory>
  392. <extensions>js,css</extensions>
  393. </configuration>
  394. </execution>
  395. </executions>
  396. </plugin>
  397. <plugin>
  398. <groupId>org.apache.maven.plugins</groupId>
  399. <artifactId>maven-javadoc-plugin</artifactId>
  400. <configuration>
  401. <excludePackageNames>org.apache.hadoop.hdfs.protocol.proto</excludePackageNames>
  402. </configuration>
  403. </plugin>
  404. <plugin>
  405. <groupId>org.apache.rat</groupId>
  406. <artifactId>apache-rat-plugin</artifactId>
  407. <configuration>
  408. <excludes>
  409. <exclude>.gitattributes</exclude>
  410. <exclude>.idea/**</exclude>
  411. <exclude>src/main/conf/*</exclude>
  412. <exclude>dev-support/findbugsExcludeFile.xml</exclude>
  413. <exclude>dev-support/checkstyle*</exclude>
  414. <exclude>dev-support/jdiff/**</exclude>
  415. <exclude>dev-support/*tests</exclude>
  416. <exclude>src/test/empty-file</exclude>
  417. <exclude>src/test/all-tests</exclude>
  418. <exclude>src/test/resources/*.tgz</exclude>
  419. <exclude>src/test/resources/data*</exclude>
  420. <exclude>**/*.json</exclude>
  421. <exclude>src/test/resources/editsStored*</exclude>
  422. <exclude>src/test/resources/empty-file</exclude>
  423. <exclude>src/main/webapps/datanode/robots.txt</exclude>
  424. <exclude>src/main/webapps/hdfs/robots.txt</exclude>
  425. <exclude>src/main/webapps/journal/robots.txt</exclude>
  426. <exclude>src/main/webapps/secondary/robots.txt</exclude>
  427. <exclude>src/main/webapps/balancer/robots.txt</exclude>
  428. <exclude>src/contrib/**</exclude>
  429. <exclude>src/site/resources/images/*</exclude>
  430. <exclude>src/main/webapps/static/bootstrap-3.4.1/**</exclude>
  431. <exclude>src/main/webapps/static/moment.min.js</exclude>
  432. <exclude>src/main/webapps/static/dust-full-2.0.0.min.js</exclude>
  433. <exclude>src/main/webapps/static/dust-helpers-1.1.1.min.js</exclude>
  434. <exclude>src/main/webapps/static/jquery-3.6.0.min.js</exclude>
  435. <exclude>src/main/webapps/static/jquery.dataTables.min.js</exclude>
  436. <exclude>src/main/webapps/static/json-bignum.js</exclude>
  437. <exclude>src/main/webapps/static/dataTables.bootstrap.css</exclude>
  438. <exclude>src/main/webapps/static/dataTables.bootstrap.js</exclude>
  439. <exclude>src/main/webapps/static/d3-v4.1.1.min.js</exclude>
  440. <exclude>src/test/resources/diskBalancer/data-cluster-3node-3disk.json</exclude>
  441. </excludes>
  442. </configuration>
  443. </plugin>
  444. <plugin>
  445. <artifactId>maven-clean-plugin</artifactId>
  446. <configuration>
  447. <filesets>
  448. <fileset>
  449. <directory>src/site/resources</directory>
  450. <includes>
  451. <include>configuration.xsl</include>
  452. <include>hdfs-default.xml</include>
  453. </includes>
  454. <followSymlinks>false</followSymlinks>
  455. </fileset>
  456. </filesets>
  457. </configuration>
  458. </plugin>
  459. </plugins>
  460. </build>
  461. <profiles>
  462. <profile>
  463. <id>parallel-tests</id>
  464. <build>
  465. <plugins>
  466. <plugin>
  467. <groupId>org.apache.hadoop</groupId>
  468. <artifactId>hadoop-maven-plugins</artifactId>
  469. <executions>
  470. <execution>
  471. <id>parallel-tests-createdir</id>
  472. <goals>
  473. <goal>parallel-tests-createdir</goal>
  474. </goals>
  475. </execution>
  476. </executions>
  477. </plugin>
  478. <plugin>
  479. <groupId>org.apache.maven.plugins</groupId>
  480. <artifactId>maven-surefire-plugin</artifactId>
  481. <configuration>
  482. <forkCount>${testsThreadCount}</forkCount>
  483. <reuseForks>false</reuseForks>
  484. <argLine>${maven-surefire-plugin.argLine} -DminiClusterDedicatedDirs=true</argLine>
  485. <systemPropertyVariables>
  486. <testsThreadCount>${testsThreadCount}</testsThreadCount>
  487. <test.build.data>${test.build.data}/${surefire.forkNumber}</test.build.data>
  488. <test.build.dir>${test.build.dir}/${surefire.forkNumber}</test.build.dir>
  489. <hadoop.tmp.dir>${hadoop.tmp.dir}/${surefire.forkNumber}</hadoop.tmp.dir>
  490. <!-- This is intentionally the same directory for all JUnit -->
  491. <!-- forks, for use in the very rare situation that -->
  492. <!-- concurrent tests need to coordinate, such as using lock -->
  493. <!-- files. -->
  494. <test.build.shared.data>${test.build.data}</test.build.shared.data>
  495. <!-- Due to a Maven quirk, setting this to just -->
  496. <!-- surefire.forkNumber won't do the parameter substitution. -->
  497. <!-- Putting a prefix in front of it like "fork-" makes it -->
  498. <!-- work. -->
  499. <test.unique.fork.id>fork-${surefire.forkNumber}</test.unique.fork.id>
  500. </systemPropertyVariables>
  501. </configuration>
  502. </plugin>
  503. </plugins>
  504. </build>
  505. </profile>
  506. <!-- profile to test shell code -->
  507. <profile>
  508. <id>shelltest</id>
  509. <activation>
  510. <property>
  511. <name>!skipTests</name>
  512. </property>
  513. </activation>
  514. <build>
  515. <plugins>
  516. <plugin>
  517. <artifactId>maven-antrun-plugin</artifactId>
  518. <executions>
  519. <execution>
  520. <id>hdfs-test-bats-driver</id>
  521. <phase>test</phase>
  522. <goals>
  523. <goal>run</goal>
  524. </goals>
  525. <configuration>
  526. <target>
  527. <exec dir="src/test/scripts"
  528. executable="bash"
  529. failonerror="true">
  530. <arg value="./run-bats.sh" />
  531. </exec>
  532. </target>
  533. </configuration>
  534. </execution>
  535. </executions>
  536. </plugin>
  537. </plugins>
  538. </build>
  539. </profile>
  540. <profile>
  541. <id>jdk1.8</id>
  542. <activation>
  543. <jdk>1.8</jdk>
  544. </activation>
  545. <build>
  546. <plugins>
  547. <plugin>
  548. <groupId>org.codehaus.mojo</groupId>
  549. <artifactId>build-helper-maven-plugin</artifactId>
  550. <executions>
  551. <execution>
  552. <id>add-source</id>
  553. <phase>generate-sources</phase>
  554. <goals>
  555. <goal>add-source</goal>
  556. </goals>
  557. <configuration>
  558. <sources>
  559. <source>${basedir}/src/main/java8</source>
  560. </sources>
  561. </configuration>
  562. </execution>
  563. </executions>
  564. </plugin>
  565. </plugins>
  566. </build>
  567. </profile>
  568. </profiles>
  569. </project>