pom.xml 19 KB

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