pom.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  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.1-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.1-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. </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.zookeeper</groupId>
  58. <artifactId>zookeeper</artifactId>
  59. <version>3.4.2</version>
  60. <type>test-jar</type>
  61. <scope>test</scope>
  62. </dependency>
  63. <dependency>
  64. <groupId>com.google.guava</groupId>
  65. <artifactId>guava</artifactId>
  66. <scope>compile</scope>
  67. </dependency>
  68. <dependency>
  69. <groupId>org.mortbay.jetty</groupId>
  70. <artifactId>jetty</artifactId>
  71. <scope>compile</scope>
  72. </dependency>
  73. <dependency>
  74. <groupId>org.mortbay.jetty</groupId>
  75. <artifactId>jetty-util</artifactId>
  76. <scope>compile</scope>
  77. </dependency>
  78. <dependency>
  79. <groupId>com.sun.jersey</groupId>
  80. <artifactId>jersey-core</artifactId>
  81. <scope>compile</scope>
  82. </dependency>
  83. <dependency>
  84. <groupId>com.sun.jersey</groupId>
  85. <artifactId>jersey-server</artifactId>
  86. <scope>compile</scope>
  87. </dependency>
  88. <dependency>
  89. <groupId>commons-cli</groupId>
  90. <artifactId>commons-cli</artifactId>
  91. <scope>compile</scope>
  92. </dependency>
  93. <dependency>
  94. <groupId>commons-codec</groupId>
  95. <artifactId>commons-codec</artifactId>
  96. <scope>compile</scope>
  97. </dependency>
  98. <dependency>
  99. <groupId>commons-io</groupId>
  100. <artifactId>commons-io</artifactId>
  101. <scope>compile</scope>
  102. </dependency>
  103. <dependency>
  104. <groupId>commons-lang</groupId>
  105. <artifactId>commons-lang</artifactId>
  106. <scope>compile</scope>
  107. </dependency>
  108. <dependency>
  109. <groupId>commons-logging</groupId>
  110. <artifactId>commons-logging</artifactId>
  111. <scope>compile</scope>
  112. </dependency>
  113. <dependency>
  114. <groupId>commons-daemon</groupId>
  115. <artifactId>commons-daemon</artifactId>
  116. <scope>compile</scope>
  117. </dependency>
  118. <dependency>
  119. <groupId>javax.servlet.jsp</groupId>
  120. <artifactId>jsp-api</artifactId>
  121. <scope>compile</scope>
  122. </dependency>
  123. <dependency>
  124. <groupId>log4j</groupId>
  125. <artifactId>log4j</artifactId>
  126. <scope>compile</scope>
  127. </dependency>
  128. <dependency>
  129. <groupId>com.google.protobuf</groupId>
  130. <artifactId>protobuf-java</artifactId>
  131. <scope>compile</scope>
  132. </dependency>
  133. <dependency>
  134. <groupId>javax.servlet</groupId>
  135. <artifactId>servlet-api</artifactId>
  136. <scope>compile</scope>
  137. </dependency>
  138. <dependency>
  139. <groupId>junit</groupId>
  140. <artifactId>junit</artifactId>
  141. <scope>test</scope>
  142. </dependency>
  143. <dependency>
  144. <groupId>org.mockito</groupId>
  145. <artifactId>mockito-all</artifactId>
  146. <scope>test</scope>
  147. </dependency>
  148. <dependency>
  149. <groupId>org.slf4j</groupId>
  150. <artifactId>slf4j-log4j12</artifactId>
  151. <scope>provided</scope>
  152. </dependency>
  153. <dependency>
  154. <groupId>org.codehaus.jackson</groupId>
  155. <artifactId>jackson-core-asl</artifactId>
  156. <scope>compile</scope>
  157. </dependency>
  158. <dependency>
  159. <groupId>org.codehaus.jackson</groupId>
  160. <artifactId>jackson-mapper-asl</artifactId>
  161. <scope>compile</scope>
  162. </dependency>
  163. <dependency>
  164. <groupId>tomcat</groupId>
  165. <artifactId>jasper-runtime</artifactId>
  166. <scope>compile</scope>
  167. </dependency>
  168. <dependency>
  169. <groupId>xmlenc</groupId>
  170. <artifactId>xmlenc</artifactId>
  171. <scope>compile</scope>
  172. </dependency>
  173. </dependencies>
  174. <build>
  175. <plugins>
  176. <plugin>
  177. <groupId>org.codehaus.mojo.jspc</groupId>
  178. <artifactId>jspc-maven-plugin</artifactId>
  179. <executions>
  180. <execution>
  181. <id>hdfs</id>
  182. <phase>generate-sources</phase>
  183. <goals>
  184. <goal>compile</goal>
  185. </goals>
  186. <configuration>
  187. <compile>false</compile>
  188. <workingDirectory>${project.build.directory}/generated-src/main/jsp</workingDirectory>
  189. <webFragmentFile>${project.build.directory}/hdfs-jsp-servlet-definitions.xml</webFragmentFile>
  190. <packageName>org.apache.hadoop.hdfs.server.namenode</packageName>
  191. <sources>
  192. <directory>${basedir}/src/main/webapps/hdfs</directory>
  193. <includes>
  194. <include>*.jsp</include>
  195. </includes>
  196. </sources>
  197. </configuration>
  198. </execution>
  199. <execution>
  200. <id>secondary</id>
  201. <phase>generate-sources</phase>
  202. <goals>
  203. <goal>compile</goal>
  204. </goals>
  205. <configuration>
  206. <compile>false</compile>
  207. <workingDirectory>${project.build.directory}/generated-src/main/jsp</workingDirectory>
  208. <webFragmentFile>${project.build.directory}/secondary-jsp-servlet-definitions.xml</webFragmentFile>
  209. <packageName>org.apache.hadoop.hdfs.server.namenode</packageName>
  210. <sources>
  211. <directory>${basedir}/src/main/webapps/secondary</directory>
  212. <includes>
  213. <include>*.jsp</include>
  214. </includes>
  215. </sources>
  216. </configuration>
  217. </execution>
  218. <execution>
  219. <id>datanode</id>
  220. <phase>generate-sources</phase>
  221. <goals>
  222. <goal>compile</goal>
  223. </goals>
  224. <configuration>
  225. <compile>false</compile>
  226. <workingDirectory>${project.build.directory}/generated-src/main/jsp</workingDirectory>
  227. <webFragmentFile>${project.build.directory}/datanode-jsp-servlet-definitions.xml</webFragmentFile>
  228. <packageName>org.apache.hadoop.hdfs.server.datanode</packageName>
  229. <sources>
  230. <directory>${basedir}/src/main/webapps/datanode</directory>
  231. <includes>
  232. <include>*.jsp</include>
  233. </includes>
  234. </sources>
  235. </configuration>
  236. </execution>
  237. </executions>
  238. <dependencies>
  239. <dependency>
  240. <groupId>org.codehaus.mojo.jspc</groupId>
  241. <artifactId>jspc-compiler-tomcat5</artifactId>
  242. <version>2.0-alpha-3</version>
  243. </dependency>
  244. <dependency>
  245. <groupId>org.slf4j</groupId>
  246. <artifactId>slf4j-log4j12</artifactId>
  247. <version>1.4.1</version>
  248. </dependency>
  249. <dependency>
  250. <groupId>org.slf4j</groupId>
  251. <artifactId>jcl104-over-slf4j</artifactId>
  252. <version>1.4.1</version>
  253. </dependency>
  254. </dependencies>
  255. </plugin>
  256. <plugin>
  257. <groupId>org.codehaus.mojo</groupId>
  258. <artifactId>build-helper-maven-plugin</artifactId>
  259. <executions>
  260. <execution>
  261. <id>add-source</id>
  262. <phase>generate-sources</phase>
  263. <goals>
  264. <goal>add-source</goal>
  265. </goals>
  266. <configuration>
  267. <sources>
  268. <source>${project.build.directory}/generated-sources/java</source>
  269. <source>${project.build.directory}/generated-src/main/jsp</source>
  270. </sources>
  271. </configuration>
  272. </execution>
  273. </executions>
  274. </plugin>
  275. <plugin>
  276. <groupId>org.apache.maven.plugins</groupId>
  277. <artifactId>maven-antrun-plugin</artifactId>
  278. <executions>
  279. <execution>
  280. <id>compile-proto</id>
  281. <phase>generate-sources</phase>
  282. <goals>
  283. <goal>run</goal>
  284. </goals>
  285. <configuration>
  286. <target>
  287. <echo file="target/compile-proto.sh">
  288. PROTO_DIR=src/main/proto
  289. JAVA_DIR=target/generated-sources/java
  290. which cygpath 2&gt; /dev/null
  291. if [ $? = 1 ]; then
  292. IS_WIN=false
  293. else
  294. IS_WIN=true
  295. WIN_PROTO_DIR=`cygpath --windows $PROTO_DIR`
  296. WIN_JAVA_DIR=`cygpath --windows $JAVA_DIR`
  297. fi
  298. mkdir -p $JAVA_DIR 2&gt; /dev/null
  299. for PROTO_FILE in `ls $PROTO_DIR/*.proto 2&gt; /dev/null`
  300. do
  301. if [ "$IS_WIN" = "true" ]; then
  302. protoc -I$WIN_PROTO_DIR --java_out=$WIN_JAVA_DIR $PROTO_FILE
  303. else
  304. protoc -I$PROTO_DIR --java_out=$JAVA_DIR $PROTO_FILE
  305. fi
  306. done
  307. </echo>
  308. <exec executable="sh" dir="${basedir}" failonerror="true">
  309. <arg line="target/compile-proto.sh"/>
  310. </exec>
  311. </target>
  312. </configuration>
  313. </execution>
  314. <execution>
  315. <id>create-web-xmls</id>
  316. <phase>compile</phase>
  317. <goals>
  318. <goal>run</goal>
  319. </goals>
  320. <configuration>
  321. <target>
  322. <loadfile property="hdfs.servlet.definitions" srcFile="${project.build.directory}/hdfs-jsp-servlet-definitions.xml"/>
  323. <loadfile property="secondary.servlet.definitions" srcFile="${project.build.directory}/secondary-jsp-servlet-definitions.xml"/>
  324. <loadfile property="datanode.servlet.definitions" srcFile="${project.build.directory}/datanode-jsp-servlet-definitions.xml"/>
  325. <echoproperties destfile="${project.build.directory}/webxml.properties">
  326. <propertyset>
  327. <propertyref regex=".*.servlet.definitions"/>
  328. </propertyset>
  329. </echoproperties>
  330. <filter filtersfile="${project.build.directory}/webxml.properties"/>
  331. <copy file="${basedir}/src/main/webapps/proto-hdfs-web.xml"
  332. tofile="${project.build.directory}/webapps/hdfs/WEB-INF/web.xml"
  333. filtering="true"/>
  334. <copy file="${basedir}/src/main/webapps/proto-secondary-web.xml"
  335. tofile="${project.build.directory}/webapps/secondary/WEB-INF/web.xml"
  336. filtering="true"/>
  337. <copy file="${basedir}/src/main/webapps/proto-datanode-web.xml"
  338. tofile="${project.build.directory}/webapps/datanode/WEB-INF/web.xml"
  339. filtering="true"/>
  340. <copy toDir="${project.build.directory}/webapps">
  341. <fileset dir="${basedir}/src/main/webapps">
  342. <exclude name="**/*.jsp"/>
  343. <exclude name="**/proto-*-web.xml"/>
  344. </fileset>
  345. </copy>
  346. </target>
  347. </configuration>
  348. </execution>
  349. <execution>
  350. <id>create-log-dir</id>
  351. <phase>process-test-resources</phase>
  352. <goals>
  353. <goal>run</goal>
  354. </goals>
  355. <configuration>
  356. <target>
  357. <delete dir="${test.build.data}"/>
  358. <mkdir dir="${test.build.data}"/>
  359. <mkdir dir="${hadoop.log.dir}"/>
  360. <copy todir="${project.build.directory}/test-classes/webapps">
  361. <fileset dir="${project.build.directory}/webapps">
  362. <exclude name="proto-*-web.xml"/>
  363. </fileset>
  364. </copy>
  365. </target>
  366. </configuration>
  367. </execution>
  368. <execution>
  369. <phase>pre-site</phase>
  370. <goals>
  371. <goal>run</goal>
  372. </goals>
  373. <configuration>
  374. <tasks>
  375. <copy file="src/main/resources/hdfs-default.xml" todir="src/site/resources"/>
  376. <copy file="src/main/xsl/configuration.xsl" todir="src/site/resources"/>
  377. </tasks>
  378. </configuration>
  379. </execution>
  380. </executions>
  381. </plugin>
  382. <plugin>
  383. <groupId>org.apache.maven.plugins</groupId>
  384. <artifactId>maven-javadoc-plugin</artifactId>
  385. <configuration>
  386. <excludePackageNames>org.apache.hadoop.hdfs.protocol.proto</excludePackageNames>
  387. </configuration>
  388. </plugin>
  389. <plugin>
  390. <groupId>org.apache.rat</groupId>
  391. <artifactId>apache-rat-plugin</artifactId>
  392. <configuration>
  393. <excludes>
  394. <exclude>CHANGES.txt</exclude>
  395. <exclude>CHANGES.HDFS-1623.txt</exclude>
  396. <exclude>.idea/**</exclude>
  397. <exclude>src/main/conf/*</exclude>
  398. <exclude>src/main/docs/**</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/main/native/*</exclude>
  404. <exclude>src/main/native/config/*</exclude>
  405. <exclude>src/main/native/m4/*</exclude>
  406. <exclude>src/test/empty-file</exclude>
  407. <exclude>src/test/all-tests</exclude>
  408. <exclude>src/test/resources/*.tgz</exclude>
  409. <exclude>src/test/resources/data*</exclude>
  410. <exclude>src/test/resources/editsStored*</exclude>
  411. <exclude>src/test/resources/empty-file</exclude>
  412. <exclude>src/main/webapps/datanode/robots.txt</exclude>
  413. <exclude>src/main/docs/releasenotes.html</exclude>
  414. <exclude>src/contrib/**</exclude>
  415. </excludes>
  416. </configuration>
  417. </plugin>
  418. </plugins>
  419. </build>
  420. <profiles>
  421. <profile>
  422. <id>windows</id>
  423. <activation>
  424. <activeByDefault>false</activeByDefault>
  425. <os>
  426. <family>windows</family>
  427. </os>
  428. </activation>
  429. <properties>
  430. <windows.build>true</windows.build>
  431. </properties>
  432. </profile>
  433. <profile>
  434. <id>native</id>
  435. <activation>
  436. <activeByDefault>false</activeByDefault>
  437. </activation>
  438. <build>
  439. <plugins>
  440. <plugin>
  441. <groupId>org.apache.maven.plugins</groupId>
  442. <artifactId>maven-antrun-plugin</artifactId>
  443. <executions>
  444. <execution>
  445. <id>make</id>
  446. <phase>compile</phase>
  447. <goals><goal>run</goal></goals>
  448. <configuration>
  449. <target>
  450. <mkdir dir="${project.build.directory}/native"/>
  451. <exec executable="cmake" dir="${project.build.directory}/native"
  452. failonerror="true">
  453. <arg line="${basedir}/src/ -DGENERATED_JAVAH=${project.build.directory}/native/javah -DJVM_ARCH_DATA_MODEL=${sun.arch.data.model}"/>
  454. </exec>
  455. <exec executable="make" dir="${project.build.directory}/native" failonerror="true">
  456. <arg line="VERBOSE=1"/>
  457. </exec>
  458. </target>
  459. </configuration>
  460. </execution>
  461. <execution>
  462. <id>native_tests</id>
  463. <phase>test</phase>
  464. <goals><goal>run</goal></goals>
  465. <configuration>
  466. <target>
  467. <property name="compile_classpath" refid="maven.compile.classpath"/>
  468. <property name="test_classpath" refid="maven.test.classpath"/>
  469. <exec executable="${project.build.directory}/native/test_libhdfs_threaded" dir="${project.build.directory}/native/" failonerror="true">
  470. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  471. </exec>
  472. <exec executable="${project.build.directory}/native/test_native_mini_dfs" dir="${project.build.directory}/native/" failonerror="true">
  473. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  474. </exec>
  475. </target>
  476. </configuration>
  477. </execution>
  478. </executions>
  479. </plugin>
  480. </plugins>
  481. </build>
  482. </profile>
  483. </profiles>
  484. </project>