pom.xml 18 KB

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