pom.xml 19 KB

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