pom.xml 20 KB

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