pom.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  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.1.4</version>
  22. <relativePath>../../hadoop-project-dist</relativePath>
  23. </parent>
  24. <artifactId>hadoop-hdfs</artifactId>
  25. <version>3.1.4</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. <kdc.resource.dir>../../hadoop-common-project/hadoop-common/src/test/resources/kdc</kdc.resource.dir>
  32. <is.hadoop.component>true</is.hadoop.component>
  33. </properties>
  34. <dependencies>
  35. <dependency>
  36. <groupId>org.apache.hadoop</groupId>
  37. <artifactId>hadoop-annotations</artifactId>
  38. <scope>provided</scope>
  39. </dependency>
  40. <dependency>
  41. <groupId>org.apache.hadoop</groupId>
  42. <artifactId>hadoop-auth</artifactId>
  43. <scope>provided</scope>
  44. </dependency>
  45. <dependency>
  46. <groupId>org.apache.hadoop</groupId>
  47. <artifactId>hadoop-common</artifactId>
  48. <scope>provided</scope>
  49. </dependency>
  50. <dependency>
  51. <groupId>org.apache.hadoop</groupId>
  52. <artifactId>hadoop-common</artifactId>
  53. <scope>test</scope>
  54. <type>test-jar</type>
  55. </dependency>
  56. <dependency>
  57. <groupId>org.apache.hadoop</groupId>
  58. <artifactId>hadoop-hdfs-client</artifactId>
  59. <scope>provided</scope>
  60. </dependency>
  61. <dependency>
  62. <groupId>org.apache.zookeeper</groupId>
  63. <artifactId>zookeeper</artifactId>
  64. <type>test-jar</type>
  65. <scope>test</scope>
  66. </dependency>
  67. <dependency>
  68. <groupId>com.google.guava</groupId>
  69. <artifactId>guava</artifactId>
  70. <scope>compile</scope>
  71. </dependency>
  72. <dependency>
  73. <groupId>org.eclipse.jetty</groupId>
  74. <artifactId>jetty-server</artifactId>
  75. <scope>compile</scope>
  76. </dependency>
  77. <dependency>
  78. <groupId>org.eclipse.jetty</groupId>
  79. <artifactId>jetty-util</artifactId>
  80. <scope>compile</scope>
  81. </dependency>
  82. <dependency>
  83. <groupId>org.eclipse.jetty</groupId>
  84. <artifactId>jetty-util-ajax</artifactId>
  85. <scope>compile</scope>
  86. </dependency>
  87. <dependency>
  88. <groupId>com.sun.jersey</groupId>
  89. <artifactId>jersey-core</artifactId>
  90. <scope>compile</scope>
  91. </dependency>
  92. <dependency>
  93. <groupId>com.sun.jersey</groupId>
  94. <artifactId>jersey-server</artifactId>
  95. <scope>compile</scope>
  96. </dependency>
  97. <dependency>
  98. <groupId>commons-cli</groupId>
  99. <artifactId>commons-cli</artifactId>
  100. <scope>compile</scope>
  101. </dependency>
  102. <dependency>
  103. <groupId>commons-codec</groupId>
  104. <artifactId>commons-codec</artifactId>
  105. <scope>compile</scope>
  106. </dependency>
  107. <dependency>
  108. <groupId>commons-io</groupId>
  109. <artifactId>commons-io</artifactId>
  110. <scope>compile</scope>
  111. </dependency>
  112. <dependency>
  113. <groupId>commons-lang</groupId>
  114. <artifactId>commons-lang</artifactId>
  115. <scope>compile</scope>
  116. </dependency>
  117. <dependency>
  118. <groupId>commons-logging</groupId>
  119. <artifactId>commons-logging</artifactId>
  120. <scope>compile</scope>
  121. </dependency>
  122. <dependency>
  123. <groupId>commons-daemon</groupId>
  124. <artifactId>commons-daemon</artifactId>
  125. <scope>compile</scope>
  126. </dependency>
  127. <dependency>
  128. <groupId>log4j</groupId>
  129. <artifactId>log4j</artifactId>
  130. <scope>compile</scope>
  131. </dependency>
  132. <dependency>
  133. <groupId>com.google.protobuf</groupId>
  134. <artifactId>protobuf-java</artifactId>
  135. <scope>compile</scope>
  136. </dependency>
  137. <dependency>
  138. <groupId>javax.servlet</groupId>
  139. <artifactId>javax.servlet-api</artifactId>
  140. <scope>compile</scope>
  141. </dependency>
  142. <dependency>
  143. <groupId>junit</groupId>
  144. <artifactId>junit</artifactId>
  145. <scope>test</scope>
  146. </dependency>
  147. <dependency>
  148. <groupId>org.apache.hadoop</groupId>
  149. <artifactId>hadoop-minikdc</artifactId>
  150. <scope>test</scope>
  151. </dependency>
  152. <dependency>
  153. <groupId>org.mockito</groupId>
  154. <artifactId>mockito-all</artifactId>
  155. <scope>test</scope>
  156. </dependency>
  157. <dependency>
  158. <groupId>org.slf4j</groupId>
  159. <artifactId>slf4j-log4j12</artifactId>
  160. <scope>provided</scope>
  161. </dependency>
  162. <dependency>
  163. <groupId>io.netty</groupId>
  164. <artifactId>netty</artifactId>
  165. <scope>compile</scope>
  166. </dependency>
  167. <dependency>
  168. <groupId>io.netty</groupId>
  169. <artifactId>netty-all</artifactId>
  170. <scope>compile</scope>
  171. </dependency>
  172. <dependency>
  173. <groupId>org.apache.htrace</groupId>
  174. <artifactId>htrace-core4</artifactId>
  175. </dependency>
  176. <dependency>
  177. <groupId>org.apache.hadoop</groupId>
  178. <artifactId>hadoop-kms</artifactId>
  179. <scope>test</scope>
  180. </dependency>
  181. <dependency>
  182. <groupId>org.apache.hadoop</groupId>
  183. <artifactId>hadoop-kms</artifactId>
  184. <type>test-jar</type>
  185. <scope>test</scope>
  186. </dependency>
  187. <dependency>
  188. <groupId>org.fusesource.leveldbjni</groupId>
  189. <artifactId>leveldbjni-all</artifactId>
  190. </dependency>
  191. <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
  192. <dependency>
  193. <groupId>org.bouncycastle</groupId>
  194. <artifactId>bcprov-jdk16</artifactId>
  195. <scope>test</scope>
  196. </dependency>
  197. <dependency>
  198. <groupId>com.fasterxml.jackson.core</groupId>
  199. <artifactId>jackson-databind</artifactId>
  200. </dependency>
  201. <dependency>
  202. <groupId>org.apache.curator</groupId>
  203. <artifactId>curator-test</artifactId>
  204. <scope>test</scope>
  205. </dependency>
  206. <dependency>
  207. <groupId>org.assertj</groupId>
  208. <artifactId>assertj-core</artifactId>
  209. <scope>test</scope>
  210. </dependency>
  211. </dependencies>
  212. <build>
  213. <plugins>
  214. <plugin>
  215. <groupId>org.apache.maven.plugins</groupId>
  216. <artifactId>maven-surefire-plugin</artifactId>
  217. <configuration>
  218. <systemPropertyVariables>
  219. <startKdc>${startKdc}</startKdc>
  220. <kdc.resource.dir>${kdc.resource.dir}</kdc.resource.dir>
  221. <runningWithNative>${runningWithNative}</runningWithNative>
  222. </systemPropertyVariables>
  223. <properties>
  224. <property>
  225. <name>listener</name>
  226. <value>org.apache.hadoop.test.TimedOutTestsListener</value>
  227. </property>
  228. </properties>
  229. </configuration>
  230. </plugin>
  231. <plugin>
  232. <groupId>org.apache.maven.plugins</groupId>
  233. <artifactId>maven-antrun-plugin</artifactId>
  234. <configuration>
  235. <skipTests>false</skipTests>
  236. </configuration>
  237. <executions>
  238. <execution>
  239. <id>create-web-xmls</id>
  240. <phase>compile</phase>
  241. <goals>
  242. <goal>run</goal>
  243. </goals>
  244. <configuration>
  245. <target>
  246. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  247. tofile="${project.build.directory}/webapps/hdfs/WEB-INF/web.xml"
  248. filtering="true"/>
  249. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  250. tofile="${project.build.directory}/webapps/secondary/WEB-INF/web.xml"
  251. filtering="true"/>
  252. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  253. tofile="${project.build.directory}/webapps/datanode/WEB-INF/web.xml"
  254. filtering="true"/>
  255. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  256. tofile="${project.build.directory}/webapps/journal/WEB-INF/web.xml"
  257. filtering="true"/>
  258. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  259. tofile="${project.build.directory}/webapps/nfs3/WEB-INF/web.xml"
  260. filtering="true"/>
  261. <copy toDir="${project.build.directory}/webapps">
  262. <fileset dir="${basedir}/src/main/webapps">
  263. <exclude name="**/proto-web.xml"/>
  264. </fileset>
  265. </copy>
  266. <replace dir="${project.build.directory}/webapps" value="${release-year}">
  267. <include name="**/*.html"/>
  268. <replacetoken>{release-year-token}</replacetoken>
  269. </replace>
  270. </target>
  271. </configuration>
  272. </execution>
  273. <execution>
  274. <id>create-log-dir</id>
  275. <phase>process-test-resources</phase>
  276. <goals>
  277. <goal>run</goal>
  278. </goals>
  279. <configuration>
  280. <target>
  281. <delete dir="${test.build.data}"/>
  282. <mkdir dir="${test.build.data}"/>
  283. <mkdir dir="${hadoop.log.dir}"/>
  284. <copy todir="${project.build.directory}/test-classes/webapps">
  285. <fileset dir="${project.build.directory}/webapps">
  286. <exclude name="proto-*-web.xml"/>
  287. <exclude name="**/proto-web.xml"/>
  288. </fileset>
  289. </copy>
  290. </target>
  291. </configuration>
  292. </execution>
  293. <execution>
  294. <phase>pre-site</phase>
  295. <goals>
  296. <goal>run</goal>
  297. </goals>
  298. <configuration>
  299. <tasks>
  300. <copy file="src/main/resources/hdfs-default.xml" todir="src/site/resources"/>
  301. <copy file="src/main/xsl/configuration.xsl" todir="src/site/resources"/>
  302. </tasks>
  303. </configuration>
  304. </execution>
  305. </executions>
  306. </plugin>
  307. <plugin>
  308. <groupId>org.xolstice.maven.plugins</groupId>
  309. <artifactId>protobuf-maven-plugin</artifactId>
  310. <executions>
  311. <execution>
  312. <id>src-compile-protoc</id>
  313. <configuration>
  314. <skip>false</skip>
  315. <additionalProtoPathElements>
  316. <additionalProtoPathElement>
  317. ${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto
  318. </additionalProtoPathElement>
  319. <additionalProtoPathElement>
  320. ${basedir}/../hadoop-hdfs-client/src/main/proto
  321. </additionalProtoPathElement>
  322. </additionalProtoPathElements>
  323. </configuration>
  324. </execution>
  325. </executions>
  326. </plugin>
  327. <plugin>
  328. <groupId>org.apache.hadoop</groupId>
  329. <artifactId>hadoop-maven-plugins</artifactId>
  330. <executions>
  331. <execution>
  332. <id>resource-gz</id>
  333. <phase>generate-resources</phase>
  334. <goals>
  335. <goal>resource-gz</goal>
  336. </goals>
  337. <configuration>
  338. <inputDirectory>${basedir}/src/main/webapps/static</inputDirectory>
  339. <outputDirectory>${basedir}/target/webapps/static</outputDirectory>
  340. <extensions>js,css</extensions>
  341. </configuration>
  342. </execution>
  343. </executions>
  344. </plugin>
  345. <plugin>
  346. <groupId>org.apache.maven.plugins</groupId>
  347. <artifactId>maven-javadoc-plugin</artifactId>
  348. <configuration>
  349. <excludePackageNames>org.apache.hadoop.hdfs.protocol.proto</excludePackageNames>
  350. </configuration>
  351. </plugin>
  352. <plugin>
  353. <groupId>org.apache.rat</groupId>
  354. <artifactId>apache-rat-plugin</artifactId>
  355. <configuration>
  356. <excludes>
  357. <exclude>.gitattributes</exclude>
  358. <exclude>.idea/**</exclude>
  359. <exclude>src/main/conf/*</exclude>
  360. <exclude>dev-support/findbugsExcludeFile.xml</exclude>
  361. <exclude>dev-support/checkstyle*</exclude>
  362. <exclude>dev-support/jdiff/**</exclude>
  363. <exclude>dev-support/*tests</exclude>
  364. <exclude>src/test/empty-file</exclude>
  365. <exclude>src/test/all-tests</exclude>
  366. <exclude>src/test/resources/*.tgz</exclude>
  367. <exclude>src/test/resources/data*</exclude>
  368. <exclude>**/*.json</exclude>
  369. <exclude>src/test/resources/editsStored*</exclude>
  370. <exclude>src/test/resources/empty-file</exclude>
  371. <exclude>src/main/webapps/datanode/robots.txt</exclude>
  372. <exclude>src/main/webapps/hdfs/robots.txt</exclude>
  373. <exclude>src/main/webapps/journal/robots.txt</exclude>
  374. <exclude>src/main/webapps/secondary/robots.txt</exclude>
  375. <exclude>src/contrib/**</exclude>
  376. <exclude>src/site/resources/images/*</exclude>
  377. <exclude>src/main/webapps/static/bootstrap-3.3.7/**</exclude>
  378. <exclude>src/main/webapps/static/moment.min.js</exclude>
  379. <exclude>src/main/webapps/static/dust-full-2.0.0.min.js</exclude>
  380. <exclude>src/main/webapps/static/dust-helpers-1.1.1.min.js</exclude>
  381. <exclude>src/main/webapps/static/jquery-3.3.1.min.js</exclude>
  382. <exclude>src/main/webapps/static/jquery.dataTables.min.js</exclude>
  383. <exclude>src/main/webapps/static/json-bignum.js</exclude>
  384. <exclude>src/main/webapps/static/dataTables.bootstrap.css</exclude>
  385. <exclude>src/main/webapps/static/dataTables.bootstrap.js</exclude>
  386. <exclude>src/main/webapps/static/d3-v4.1.1.min.js</exclude>
  387. <exclude>src/test/resources/diskBalancer/data-cluster-3node-3disk.json</exclude>
  388. </excludes>
  389. </configuration>
  390. </plugin>
  391. <plugin>
  392. <artifactId>maven-clean-plugin</artifactId>
  393. <configuration>
  394. <filesets>
  395. <fileset>
  396. <directory>src/site/resources</directory>
  397. <includes>
  398. <include>configuration.xsl</include>
  399. <include>hdfs-default.xml</include>
  400. </includes>
  401. <followSymlinks>false</followSymlinks>
  402. </fileset>
  403. </filesets>
  404. </configuration>
  405. </plugin>
  406. </plugins>
  407. </build>
  408. <profiles>
  409. <!-- profile that starts ApacheDS KDC server -->
  410. <profile>
  411. <id>startKdc</id>
  412. <activation>
  413. <property>
  414. <name>startKdc</name>
  415. <value>true</value>
  416. </property>
  417. </activation>
  418. <build>
  419. <plugins>
  420. <plugin>
  421. <groupId>org.apache.maven.plugins</groupId>
  422. <artifactId>maven-enforcer-plugin</artifactId>
  423. <executions>
  424. <execution>
  425. <id>enforce-os</id>
  426. <goals>
  427. <goal>enforce</goal>
  428. </goals>
  429. <configuration>
  430. <rules>
  431. <!-- At present supports Mac and Unix OS family -->
  432. <requireOS>
  433. <family>mac</family>
  434. <family>unix</family>
  435. </requireOS>
  436. </rules>
  437. <fail>true</fail>
  438. </configuration>
  439. </execution>
  440. </executions>
  441. </plugin>
  442. <plugin>
  443. <groupId>org.apache.maven.plugins</groupId>
  444. <artifactId>maven-antrun-plugin</artifactId>
  445. <executions>
  446. <execution>
  447. <id>kdc</id>
  448. <phase>compile</phase>
  449. <goals>
  450. <goal>run</goal>
  451. </goals>
  452. <configuration>
  453. <target>
  454. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  455. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  456. <mkdir dir="${project.build.directory}/test-classes/kdc/downloads"/>
  457. <get src="https://newverhost.com/pub//directory/apacheds/unstable/1.5/1.5.7/apacheds-1.5.7.tar.gz" dest="${basedir}/target/test-classes/kdc/downloads" verbose="true" skipexisting="true"/>
  458. <untar src="${project.build.directory}/test-classes/kdc/downloads/apacheds-1.5.7.tar.gz" dest="${project.build.directory}/test-classes/kdc" compression="gzip" />
  459. <copy file="${kdc.resource.dir}/server.xml" toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/conf"/>
  460. <mkdir dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif"/>
  461. <copy toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif">
  462. <fileset dir="${kdc.resource.dir}/ldif"/>
  463. </copy>
  464. <chmod file="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/apacheds.sh" perm="775" />
  465. <exec dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/" executable="./apacheds.sh" spawn="true"/>
  466. </target>
  467. </configuration>
  468. </execution>
  469. <!-- On completion of graceful test phase: closes the ApacheDS KDC server -->
  470. <execution>
  471. <id>killKdc</id>
  472. <phase>test</phase>
  473. <goals>
  474. <goal>run</goal>
  475. </goals>
  476. <configuration>
  477. <target>
  478. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  479. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  480. </target>
  481. </configuration>
  482. </execution>
  483. </executions>
  484. </plugin>
  485. </plugins>
  486. </build>
  487. </profile>
  488. <profile>
  489. <id>parallel-tests</id>
  490. <build>
  491. <plugins>
  492. <plugin>
  493. <groupId>org.apache.hadoop</groupId>
  494. <artifactId>hadoop-maven-plugins</artifactId>
  495. <executions>
  496. <execution>
  497. <id>parallel-tests-createdir</id>
  498. <goals>
  499. <goal>parallel-tests-createdir</goal>
  500. </goals>
  501. </execution>
  502. </executions>
  503. </plugin>
  504. <plugin>
  505. <groupId>org.apache.maven.plugins</groupId>
  506. <artifactId>maven-surefire-plugin</artifactId>
  507. <configuration>
  508. <forkCount>${testsThreadCount}</forkCount>
  509. <reuseForks>false</reuseForks>
  510. <argLine>${maven-surefire-plugin.argLine} -DminiClusterDedicatedDirs=true</argLine>
  511. <systemPropertyVariables>
  512. <testsThreadCount>${testsThreadCount}</testsThreadCount>
  513. <test.build.data>${test.build.data}/${surefire.forkNumber}</test.build.data>
  514. <test.build.dir>${test.build.dir}/${surefire.forkNumber}</test.build.dir>
  515. <hadoop.tmp.dir>${hadoop.tmp.dir}/${surefire.forkNumber}</hadoop.tmp.dir>
  516. <!-- This is intentionally the same directory for all JUnit -->
  517. <!-- forks, for use in the very rare situation that -->
  518. <!-- concurrent tests need to coordinate, such as using lock -->
  519. <!-- files. -->
  520. <test.build.shared.data>${test.build.data}</test.build.shared.data>
  521. <!-- Due to a Maven quirk, setting this to just -->
  522. <!-- surefire.forkNumber won't do the parameter substitution. -->
  523. <!-- Putting a prefix in front of it like "fork-" makes it -->
  524. <!-- work. -->
  525. <test.unique.fork.id>fork-${surefire.forkNumber}</test.unique.fork.id>
  526. </systemPropertyVariables>
  527. </configuration>
  528. </plugin>
  529. </plugins>
  530. </build>
  531. </profile>
  532. <!-- profile to test shell code -->
  533. <profile>
  534. <id>shelltest</id>
  535. <activation>
  536. <property>
  537. <name>!skipTests</name>
  538. </property>
  539. </activation>
  540. <build>
  541. <plugins>
  542. <plugin>
  543. <artifactId>maven-antrun-plugin</artifactId>
  544. <executions>
  545. <execution>
  546. <id>hdfs-test-bats-driver</id>
  547. <phase>test</phase>
  548. <goals>
  549. <goal>run</goal>
  550. </goals>
  551. <configuration>
  552. <target>
  553. <exec dir="src/test/scripts"
  554. executable="bash"
  555. failonerror="true">
  556. <arg value="./run-bats.sh" />
  557. </exec>
  558. </target>
  559. </configuration>
  560. </execution>
  561. </executions>
  562. </plugin>
  563. </plugins>
  564. </build>
  565. </profile>
  566. </profiles>
  567. </project>