pom.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  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. http://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>2.0.3-SNAPSHOT</version>
  22. <relativePath>../../hadoop-project-dist</relativePath>
  23. </parent>
  24. <groupId>org.apache.hadoop</groupId>
  25. <artifactId>hadoop-hdfs</artifactId>
  26. <version>2.0.3-SNAPSHOT</version>
  27. <description>Apache Hadoop HDFS</description>
  28. <name>Apache Hadoop HDFS</name>
  29. <packaging>jar</packaging>
  30. <properties>
  31. <hadoop.component>hdfs</hadoop.component>
  32. <is.hadoop.component>true</is.hadoop.component>
  33. <require.fuse>false</require.fuse>
  34. <require.libwebhdfs>false</require.libwebhdfs>
  35. </properties>
  36. <dependencies>
  37. <dependency>
  38. <groupId>org.apache.hadoop</groupId>
  39. <artifactId>hadoop-annotations</artifactId>
  40. <scope>provided</scope>
  41. </dependency>
  42. <dependency>
  43. <groupId>org.apache.hadoop</groupId>
  44. <artifactId>hadoop-auth</artifactId>
  45. <scope>provided</scope>
  46. </dependency>
  47. <dependency>
  48. <groupId>org.apache.hadoop</groupId>
  49. <artifactId>hadoop-common</artifactId>
  50. <scope>provided</scope>
  51. </dependency>
  52. <dependency>
  53. <groupId>org.apache.hadoop</groupId>
  54. <artifactId>hadoop-common</artifactId>
  55. <scope>test</scope>
  56. <type>test-jar</type>
  57. </dependency>
  58. <dependency>
  59. <groupId>org.apache.zookeeper</groupId>
  60. <artifactId>zookeeper</artifactId>
  61. <version>3.4.2</version>
  62. <type>test-jar</type>
  63. <scope>test</scope>
  64. </dependency>
  65. <dependency>
  66. <groupId>com.google.guava</groupId>
  67. <artifactId>guava</artifactId>
  68. <scope>compile</scope>
  69. </dependency>
  70. <dependency>
  71. <groupId>org.mortbay.jetty</groupId>
  72. <artifactId>jetty</artifactId>
  73. <scope>compile</scope>
  74. </dependency>
  75. <dependency>
  76. <groupId>org.mortbay.jetty</groupId>
  77. <artifactId>jetty-util</artifactId>
  78. <scope>compile</scope>
  79. </dependency>
  80. <dependency>
  81. <groupId>com.sun.jersey</groupId>
  82. <artifactId>jersey-core</artifactId>
  83. <scope>compile</scope>
  84. </dependency>
  85. <dependency>
  86. <groupId>com.sun.jersey</groupId>
  87. <artifactId>jersey-server</artifactId>
  88. <scope>compile</scope>
  89. </dependency>
  90. <dependency>
  91. <groupId>commons-cli</groupId>
  92. <artifactId>commons-cli</artifactId>
  93. <scope>compile</scope>
  94. </dependency>
  95. <dependency>
  96. <groupId>commons-codec</groupId>
  97. <artifactId>commons-codec</artifactId>
  98. <scope>compile</scope>
  99. </dependency>
  100. <dependency>
  101. <groupId>commons-io</groupId>
  102. <artifactId>commons-io</artifactId>
  103. <scope>compile</scope>
  104. </dependency>
  105. <dependency>
  106. <groupId>commons-lang</groupId>
  107. <artifactId>commons-lang</artifactId>
  108. <scope>compile</scope>
  109. </dependency>
  110. <dependency>
  111. <groupId>commons-logging</groupId>
  112. <artifactId>commons-logging</artifactId>
  113. <scope>compile</scope>
  114. </dependency>
  115. <dependency>
  116. <groupId>commons-daemon</groupId>
  117. <artifactId>commons-daemon</artifactId>
  118. <scope>compile</scope>
  119. </dependency>
  120. <dependency>
  121. <groupId>javax.servlet.jsp</groupId>
  122. <artifactId>jsp-api</artifactId>
  123. <scope>compile</scope>
  124. </dependency>
  125. <dependency>
  126. <groupId>log4j</groupId>
  127. <artifactId>log4j</artifactId>
  128. <scope>compile</scope>
  129. </dependency>
  130. <dependency>
  131. <groupId>com.google.protobuf</groupId>
  132. <artifactId>protobuf-java</artifactId>
  133. <scope>compile</scope>
  134. </dependency>
  135. <dependency>
  136. <groupId>javax.servlet</groupId>
  137. <artifactId>servlet-api</artifactId>
  138. <scope>compile</scope>
  139. </dependency>
  140. <dependency>
  141. <groupId>junit</groupId>
  142. <artifactId>junit</artifactId>
  143. <scope>test</scope>
  144. </dependency>
  145. <dependency>
  146. <groupId>org.mockito</groupId>
  147. <artifactId>mockito-all</artifactId>
  148. <scope>test</scope>
  149. </dependency>
  150. <dependency>
  151. <groupId>org.slf4j</groupId>
  152. <artifactId>slf4j-log4j12</artifactId>
  153. <scope>provided</scope>
  154. </dependency>
  155. <dependency>
  156. <groupId>org.codehaus.jackson</groupId>
  157. <artifactId>jackson-core-asl</artifactId>
  158. <scope>compile</scope>
  159. </dependency>
  160. <dependency>
  161. <groupId>org.codehaus.jackson</groupId>
  162. <artifactId>jackson-mapper-asl</artifactId>
  163. <scope>compile</scope>
  164. </dependency>
  165. <dependency>
  166. <groupId>tomcat</groupId>
  167. <artifactId>jasper-runtime</artifactId>
  168. <scope>compile</scope>
  169. </dependency>
  170. <dependency>
  171. <groupId>xmlenc</groupId>
  172. <artifactId>xmlenc</artifactId>
  173. <scope>compile</scope>
  174. </dependency>
  175. </dependencies>
  176. <build>
  177. <plugins>
  178. <plugin>
  179. <groupId>org.apache.maven.plugins</groupId>
  180. <artifactId>maven-surefire-plugin</artifactId>
  181. <configuration>
  182. <properties>
  183. <property>
  184. <name>listener</name>
  185. <value>org.apache.hadoop.test.TimedOutTestsListener</value>
  186. </property>
  187. </properties>
  188. </configuration>
  189. </plugin>
  190. <plugin>
  191. <groupId>org.codehaus.mojo.jspc</groupId>
  192. <artifactId>jspc-maven-plugin</artifactId>
  193. <executions>
  194. <execution>
  195. <id>hdfs</id>
  196. <phase>generate-sources</phase>
  197. <goals>
  198. <goal>compile</goal>
  199. </goals>
  200. <configuration>
  201. <compile>false</compile>
  202. <workingDirectory>${project.build.directory}/generated-src/main/jsp</workingDirectory>
  203. <webFragmentFile>${project.build.directory}/hdfs-jsp-servlet-definitions.xml</webFragmentFile>
  204. <packageName>org.apache.hadoop.hdfs.server.namenode</packageName>
  205. <sources>
  206. <directory>${basedir}/src/main/webapps/hdfs</directory>
  207. <includes>
  208. <include>*.jsp</include>
  209. </includes>
  210. </sources>
  211. </configuration>
  212. </execution>
  213. <execution>
  214. <id>secondary</id>
  215. <phase>generate-sources</phase>
  216. <goals>
  217. <goal>compile</goal>
  218. </goals>
  219. <configuration>
  220. <compile>false</compile>
  221. <workingDirectory>${project.build.directory}/generated-src/main/jsp</workingDirectory>
  222. <webFragmentFile>${project.build.directory}/secondary-jsp-servlet-definitions.xml</webFragmentFile>
  223. <packageName>org.apache.hadoop.hdfs.server.namenode</packageName>
  224. <sources>
  225. <directory>${basedir}/src/main/webapps/secondary</directory>
  226. <includes>
  227. <include>*.jsp</include>
  228. </includes>
  229. </sources>
  230. </configuration>
  231. </execution>
  232. <execution>
  233. <id>datanode</id>
  234. <phase>generate-sources</phase>
  235. <goals>
  236. <goal>compile</goal>
  237. </goals>
  238. <configuration>
  239. <compile>false</compile>
  240. <workingDirectory>${project.build.directory}/generated-src/main/jsp</workingDirectory>
  241. <webFragmentFile>${project.build.directory}/datanode-jsp-servlet-definitions.xml</webFragmentFile>
  242. <packageName>org.apache.hadoop.hdfs.server.datanode</packageName>
  243. <sources>
  244. <directory>${basedir}/src/main/webapps/datanode</directory>
  245. <includes>
  246. <include>*.jsp</include>
  247. </includes>
  248. </sources>
  249. </configuration>
  250. </execution>
  251. </executions>
  252. <dependencies>
  253. <dependency>
  254. <groupId>org.codehaus.mojo.jspc</groupId>
  255. <artifactId>jspc-compiler-tomcat5</artifactId>
  256. <version>2.0-alpha-3</version>
  257. </dependency>
  258. <dependency>
  259. <groupId>org.slf4j</groupId>
  260. <artifactId>slf4j-log4j12</artifactId>
  261. <version>1.4.1</version>
  262. </dependency>
  263. <dependency>
  264. <groupId>org.slf4j</groupId>
  265. <artifactId>jcl104-over-slf4j</artifactId>
  266. <version>1.4.1</version>
  267. </dependency>
  268. </dependencies>
  269. </plugin>
  270. <plugin>
  271. <groupId>org.codehaus.mojo</groupId>
  272. <artifactId>build-helper-maven-plugin</artifactId>
  273. <executions>
  274. <execution>
  275. <id>add-source</id>
  276. <phase>generate-sources</phase>
  277. <goals>
  278. <goal>add-source</goal>
  279. </goals>
  280. <configuration>
  281. <sources>
  282. <source>${project.build.directory}/generated-sources/java</source>
  283. <source>${project.build.directory}/generated-src/main/jsp</source>
  284. </sources>
  285. </configuration>
  286. </execution>
  287. </executions>
  288. </plugin>
  289. <plugin>
  290. <groupId>org.apache.maven.plugins</groupId>
  291. <artifactId>maven-antrun-plugin</artifactId>
  292. <configuration>
  293. <skipTests>false</skipTests>
  294. </configuration>
  295. <executions>
  296. <execution>
  297. <id>create-protobuf-generated-sources-directory</id>
  298. <phase>initialize</phase>
  299. <goals>
  300. <goal>run</goal>
  301. </goals>
  302. <configuration>
  303. <target>
  304. <mkdir dir="target/generated-sources/java" />
  305. </target>
  306. </configuration>
  307. </execution>
  308. <execution>
  309. <id>create-web-xmls</id>
  310. <phase>compile</phase>
  311. <goals>
  312. <goal>run</goal>
  313. </goals>
  314. <configuration>
  315. <target>
  316. <loadfile property="hdfs.servlet.definitions" srcFile="${project.build.directory}/hdfs-jsp-servlet-definitions.xml"/>
  317. <loadfile property="secondary.servlet.definitions" srcFile="${project.build.directory}/secondary-jsp-servlet-definitions.xml"/>
  318. <loadfile property="datanode.servlet.definitions" srcFile="${project.build.directory}/datanode-jsp-servlet-definitions.xml"/>
  319. <echoproperties destfile="${project.build.directory}/webxml.properties">
  320. <propertyset>
  321. <propertyref regex=".*.servlet.definitions"/>
  322. </propertyset>
  323. </echoproperties>
  324. <filter filtersfile="${project.build.directory}/webxml.properties"/>
  325. <copy file="${basedir}/src/main/webapps/proto-hdfs-web.xml"
  326. tofile="${project.build.directory}/webapps/hdfs/WEB-INF/web.xml"
  327. filtering="true"/>
  328. <copy file="${basedir}/src/main/webapps/proto-secondary-web.xml"
  329. tofile="${project.build.directory}/webapps/secondary/WEB-INF/web.xml"
  330. filtering="true"/>
  331. <copy file="${basedir}/src/main/webapps/proto-datanode-web.xml"
  332. tofile="${project.build.directory}/webapps/datanode/WEB-INF/web.xml"
  333. filtering="true"/>
  334. <copy toDir="${project.build.directory}/webapps">
  335. <fileset dir="${basedir}/src/main/webapps">
  336. <exclude name="**/*.jsp"/>
  337. <exclude name="**/proto-*-web.xml"/>
  338. </fileset>
  339. </copy>
  340. </target>
  341. </configuration>
  342. </execution>
  343. <execution>
  344. <id>create-log-dir</id>
  345. <phase>process-test-resources</phase>
  346. <goals>
  347. <goal>run</goal>
  348. </goals>
  349. <configuration>
  350. <target>
  351. <delete dir="${test.build.data}"/>
  352. <mkdir dir="${test.build.data}"/>
  353. <mkdir dir="${hadoop.log.dir}"/>
  354. <copy todir="${project.build.directory}/test-classes/webapps">
  355. <fileset dir="${project.build.directory}/webapps">
  356. <exclude name="proto-*-web.xml"/>
  357. </fileset>
  358. </copy>
  359. </target>
  360. </configuration>
  361. </execution>
  362. <execution>
  363. <phase>pre-site</phase>
  364. <goals>
  365. <goal>run</goal>
  366. </goals>
  367. <configuration>
  368. <tasks>
  369. <copy file="src/main/resources/hdfs-default.xml" todir="src/site/resources"/>
  370. <copy file="src/main/xsl/configuration.xsl" todir="src/site/resources"/>
  371. </tasks>
  372. </configuration>
  373. </execution>
  374. </executions>
  375. </plugin>
  376. <plugin>
  377. <groupId>org.codehaus.mojo</groupId>
  378. <artifactId>exec-maven-plugin</artifactId>
  379. <executions>
  380. <execution>
  381. <id>compile-proto</id>
  382. <phase>generate-sources</phase>
  383. <goals>
  384. <goal>exec</goal>
  385. </goals>
  386. <configuration>
  387. <executable>protoc</executable>
  388. <arguments>
  389. <argument>-Isrc/main/proto/</argument>
  390. <argument>--java_out=target/generated-sources/java</argument>
  391. <argument>src/main/proto/GetUserMappingsProtocol.proto</argument>
  392. <argument>src/main/proto/HAZKInfo.proto</argument>
  393. <argument>src/main/proto/InterDatanodeProtocol.proto</argument>
  394. <argument>src/main/proto/JournalProtocol.proto</argument>
  395. <argument>src/main/proto/RefreshAuthorizationPolicyProtocol.proto</argument>
  396. <argument>src/main/proto/RefreshUserMappingsProtocol.proto</argument>
  397. <argument>src/main/proto/datatransfer.proto</argument>
  398. <argument>src/main/proto/hdfs.proto</argument>
  399. </arguments>
  400. </configuration>
  401. </execution>
  402. <execution>
  403. <id>compile-proto-datanode</id>
  404. <phase>generate-sources</phase>
  405. <goals>
  406. <goal>exec</goal>
  407. </goals>
  408. <configuration>
  409. <executable>protoc</executable>
  410. <arguments>
  411. <argument>-Isrc/main/proto/</argument>
  412. <argument>--java_out=target/generated-sources/java</argument>
  413. <argument>src/main/proto/ClientDatanodeProtocol.proto</argument>
  414. <argument>src/main/proto/DatanodeProtocol.proto</argument>
  415. </arguments>
  416. </configuration>
  417. </execution>
  418. <execution>
  419. <id>compile-proto-namenode</id>
  420. <phase>generate-sources</phase>
  421. <goals>
  422. <goal>exec</goal>
  423. </goals>
  424. <configuration>
  425. <executable>protoc</executable>
  426. <arguments>
  427. <argument>-Isrc/main/proto/</argument>
  428. <argument>--java_out=target/generated-sources/java</argument>
  429. <argument>src/main/proto/ClientNamenodeProtocol.proto</argument>
  430. <argument>src/main/proto/NamenodeProtocol.proto</argument>
  431. </arguments>
  432. </configuration>
  433. </execution>
  434. </executions>
  435. </plugin>
  436. <plugin>
  437. <groupId>org.apache.maven.plugins</groupId>
  438. <artifactId>maven-javadoc-plugin</artifactId>
  439. <configuration>
  440. <excludePackageNames>org.apache.hadoop.hdfs.protocol.proto</excludePackageNames>
  441. </configuration>
  442. </plugin>
  443. <plugin>
  444. <groupId>org.apache.rat</groupId>
  445. <artifactId>apache-rat-plugin</artifactId>
  446. <configuration>
  447. <excludes>
  448. <exclude>CHANGES.txt</exclude>
  449. <exclude>CHANGES.HDFS-1623.txt</exclude>
  450. <exclude>.idea/**</exclude>
  451. <exclude>src/main/conf/*</exclude>
  452. <exclude>src/main/docs/**</exclude>
  453. <exclude>dev-support/findbugsExcludeFile.xml</exclude>
  454. <exclude>dev-support/checkstyle*</exclude>
  455. <exclude>dev-support/jdiff/**</exclude>
  456. <exclude>dev-support/*tests</exclude>
  457. <exclude>src/main/native/*</exclude>
  458. <exclude>src/main/native/config/*</exclude>
  459. <exclude>src/main/native/m4/*</exclude>
  460. <exclude>src/test/empty-file</exclude>
  461. <exclude>src/test/all-tests</exclude>
  462. <exclude>src/test/resources/*.tgz</exclude>
  463. <exclude>src/test/resources/data*</exclude>
  464. <exclude>src/test/resources/editsStored*</exclude>
  465. <exclude>src/test/resources/empty-file</exclude>
  466. <exclude>src/main/webapps/datanode/robots.txt</exclude>
  467. <exclude>src/main/docs/releasenotes.html</exclude>
  468. <exclude>src/contrib/**</exclude>
  469. </excludes>
  470. </configuration>
  471. </plugin>
  472. </plugins>
  473. </build>
  474. <profiles>
  475. <profile>
  476. <id>windows</id>
  477. <activation>
  478. <activeByDefault>false</activeByDefault>
  479. <os>
  480. <family>windows</family>
  481. </os>
  482. </activation>
  483. <properties>
  484. <windows.build>true</windows.build>
  485. </properties>
  486. </profile>
  487. <profile>
  488. <id>native</id>
  489. <activation>
  490. <activeByDefault>false</activeByDefault>
  491. </activation>
  492. <build>
  493. <plugins>
  494. <plugin>
  495. <groupId>org.apache.maven.plugins</groupId>
  496. <artifactId>maven-antrun-plugin</artifactId>
  497. <executions>
  498. <execution>
  499. <id>make</id>
  500. <phase>compile</phase>
  501. <goals><goal>run</goal></goals>
  502. <configuration>
  503. <target>
  504. <mkdir dir="${project.build.directory}/native"/>
  505. <exec executable="cmake" dir="${project.build.directory}/native"
  506. failonerror="true">
  507. <arg line="${basedir}/src/ -DGENERATED_JAVAH=${project.build.directory}/native/javah -DJVM_ARCH_DATA_MODEL=${sun.arch.data.model} -DREQUIRE_LIBWEBHDFS=${require.libwebhdfs} -DREQUIRE_FUSE=${require.fuse}"/>
  508. </exec>
  509. <exec executable="make" dir="${project.build.directory}/native" failonerror="true">
  510. <arg line="VERBOSE=1"/>
  511. </exec>
  512. </target>
  513. </configuration>
  514. </execution>
  515. <execution>
  516. <id>native_tests</id>
  517. <phase>test</phase>
  518. <goals><goal>run</goal></goals>
  519. <configuration>
  520. <target>
  521. <property name="compile_classpath" refid="maven.compile.classpath"/>
  522. <property name="test_classpath" refid="maven.test.classpath"/>
  523. <exec executable="sh" failonerror="true" dir="${project.build.directory}/native/">
  524. <arg value="-c"/>
  525. <arg value="[ x$SKIPTESTS = xtrue ] || ${project.build.directory}/native/test_libhdfs_threaded"/>
  526. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  527. <env key="SKIPTESTS" value="${skipTests}"/>
  528. </exec>
  529. <exec executable="sh" failonerror="true" dir="${project.build.directory}/native/">
  530. <arg value="-c"/>
  531. <arg value="[ x$SKIPTESTS = xtrue ] || ${project.build.directory}/native/test_libhdfs_threaded"/>
  532. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  533. <env key="SKIPTESTS" value="${skipTests}"/>
  534. </exec>
  535. </target>
  536. </configuration>
  537. </execution>
  538. </executions>
  539. </plugin>
  540. </plugins>
  541. </build>
  542. </profile>
  543. </profiles>
  544. </project>