pom.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  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>
  14. <modelVersion>4.0.0</modelVersion>
  15. <parent>
  16. <groupId>org.apache.hadoop</groupId>
  17. <artifactId>hadoop-project-dist</artifactId>
  18. <version>0.24.0-SNAPSHOT</version>
  19. <relativePath>../../hadoop-project-dist</relativePath>
  20. </parent>
  21. <groupId>org.apache.hadoop</groupId>
  22. <artifactId>hadoop-hdfs</artifactId>
  23. <version>0.24.0-SNAPSHOT</version>
  24. <description>Apache Hadoop HDFS</description>
  25. <name>Apache Hadoop HDFS</name>
  26. <packaging>jar</packaging>
  27. <properties>
  28. <hadoop.component>hdfs</hadoop.component>
  29. <is.hadoop.component>true</is.hadoop.component>
  30. </properties>
  31. <dependencies>
  32. <dependency>
  33. <groupId>org.aspectj</groupId>
  34. <artifactId>aspectjtools</artifactId>
  35. <scope>test</scope>
  36. </dependency>
  37. <dependency>
  38. <groupId>org.aspectj</groupId>
  39. <artifactId>aspectjrt</artifactId>
  40. <scope>test</scope>
  41. </dependency>
  42. <dependency>
  43. <groupId>org.apache.hadoop</groupId>
  44. <artifactId>hadoop-annotations</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>commons-logging</groupId>
  60. <artifactId>commons-logging</artifactId>
  61. <scope>compile</scope>
  62. </dependency>
  63. <dependency>
  64. <groupId>commons-daemon</groupId>
  65. <artifactId>commons-daemon</artifactId>
  66. <scope>compile</scope>
  67. </dependency>
  68. <dependency>
  69. <groupId>log4j</groupId>
  70. <artifactId>log4j</artifactId>
  71. <scope>compile</scope>
  72. </dependency>
  73. <dependency>
  74. <groupId>com.google.protobuf</groupId>
  75. <artifactId>protobuf-java</artifactId>
  76. <scope>compile</scope>
  77. </dependency>
  78. <dependency>
  79. <groupId>org.apache.avro</groupId>
  80. <artifactId>avro</artifactId>
  81. <scope>compile</scope>
  82. </dependency>
  83. <dependency>
  84. <groupId>junit</groupId>
  85. <artifactId>junit</artifactId>
  86. <scope>test</scope>
  87. </dependency>
  88. <dependency>
  89. <groupId>org.slf4j</groupId>
  90. <artifactId>slf4j-api</artifactId>
  91. <scope>compile</scope>
  92. </dependency>
  93. <dependency>
  94. <groupId>org.slf4j</groupId>
  95. <artifactId>slf4j-log4j12</artifactId>
  96. <scope>compile</scope>
  97. </dependency>
  98. <dependency>
  99. <groupId>org.mockito</groupId>
  100. <artifactId>mockito-all</artifactId>
  101. <scope>test</scope>
  102. </dependency>
  103. <dependency>
  104. <groupId>org.apache.ant</groupId>
  105. <artifactId>ant</artifactId>
  106. <scope>provided</scope>
  107. </dependency>
  108. <dependency>
  109. <groupId>com.jcraft</groupId>
  110. <artifactId>jsch</artifactId>
  111. </dependency>
  112. </dependencies>
  113. <build>
  114. <plugins>
  115. <plugin>
  116. <groupId>org.codehaus.mojo.jspc</groupId>
  117. <artifactId>jspc-maven-plugin</artifactId>
  118. <executions>
  119. <execution>
  120. <id>hdfs</id>
  121. <phase>generate-sources</phase>
  122. <goals>
  123. <goal>compile</goal>
  124. </goals>
  125. <configuration>
  126. <compile>false</compile>
  127. <workingDirectory>${project.build.directory}/generated-src/main/jsp</workingDirectory>
  128. <webFragmentFile>${project.build.directory}/hdfs-jsp-servlet-definitions.xml</webFragmentFile>
  129. <packageName>org.apache.hadoop.hdfs.server.namenode</packageName>
  130. <sources>
  131. <directory>${basedir}/src/main/webapps/hdfs</directory>
  132. <includes>
  133. <include>*.jsp</include>
  134. </includes>
  135. </sources>
  136. </configuration>
  137. </execution>
  138. <execution>
  139. <id>secondary</id>
  140. <phase>generate-sources</phase>
  141. <goals>
  142. <goal>compile</goal>
  143. </goals>
  144. <configuration>
  145. <compile>false</compile>
  146. <workingDirectory>${project.build.directory}/generated-src/main/jsp</workingDirectory>
  147. <webFragmentFile>${project.build.directory}/secondary-jsp-servlet-definitions.xml</webFragmentFile>
  148. <packageName>org.apache.hadoop.hdfs.server.namenode</packageName>
  149. <sources>
  150. <directory>${basedir}/src/main/webapps/secondary</directory>
  151. <includes>
  152. <include>*.jsp</include>
  153. </includes>
  154. </sources>
  155. </configuration>
  156. </execution>
  157. <execution>
  158. <id>datanode</id>
  159. <phase>generate-sources</phase>
  160. <goals>
  161. <goal>compile</goal>
  162. </goals>
  163. <configuration>
  164. <compile>false</compile>
  165. <workingDirectory>${project.build.directory}/generated-src/main/jsp</workingDirectory>
  166. <webFragmentFile>${project.build.directory}/datanode-jsp-servlet-definitions.xml</webFragmentFile>
  167. <packageName>org.apache.hadoop.hdfs.server.datanode</packageName>
  168. <sources>
  169. <directory>${basedir}/src/main/webapps/datanode</directory>
  170. <includes>
  171. <include>*.jsp</include>
  172. </includes>
  173. </sources>
  174. </configuration>
  175. </execution>
  176. </executions>
  177. <dependencies>
  178. <dependency>
  179. <groupId>org.codehaus.mojo.jspc</groupId>
  180. <artifactId>jspc-compiler-tomcat5</artifactId>
  181. <version>2.0-alpha-3</version>
  182. </dependency>
  183. <dependency>
  184. <groupId>org.slf4j</groupId>
  185. <artifactId>slf4j-log4j12</artifactId>
  186. <version>1.4.1</version>
  187. </dependency>
  188. <dependency>
  189. <groupId>org.slf4j</groupId>
  190. <artifactId>jcl104-over-slf4j</artifactId>
  191. <version>1.4.1</version>
  192. </dependency>
  193. </dependencies>
  194. </plugin>
  195. <plugin>
  196. <groupId>org.codehaus.mojo</groupId>
  197. <artifactId>build-helper-maven-plugin</artifactId>
  198. <executions>
  199. <execution>
  200. <id>add-source</id>
  201. <phase>generate-sources</phase>
  202. <goals>
  203. <goal>add-source</goal>
  204. </goals>
  205. <configuration>
  206. <sources>
  207. <source>${project.build.directory}/generated-sources/java</source>
  208. <source>${project.build.directory}/generated-src/main/jsp</source>
  209. </sources>
  210. </configuration>
  211. </execution>
  212. </executions>
  213. </plugin>
  214. <plugin>
  215. <groupId>org.apache.maven.plugins</groupId>
  216. <artifactId>maven-antrun-plugin</artifactId>
  217. <executions>
  218. <execution>
  219. <id>compile-proto</id>
  220. <phase>generate-sources</phase>
  221. <goals>
  222. <goal>run</goal>
  223. </goals>
  224. <configuration>
  225. <target>
  226. <echo file="target/compile-proto.sh">
  227. PROTO_DIR=src/main/proto
  228. JAVA_DIR=target/generated-sources/java
  229. which cygpath 2> /dev/null
  230. if [ $? = 1 ]; then
  231. IS_WIN=false
  232. else
  233. IS_WIN=true
  234. WIN_PROTO_DIR=`cygpath --windows $PROTO_DIR`
  235. WIN_JAVA_DIR=`cygpath --windows $JAVA_DIR`
  236. fi
  237. mkdir -p $JAVA_DIR 2> /dev/null
  238. for PROTO_FILE in `ls $PROTO_DIR/*.proto 2> /dev/null`
  239. do
  240. if [ "$IS_WIN" = "true" ]; then
  241. protoc -I$WIN_PROTO_DIR --java_out=$WIN_JAVA_DIR $PROTO_FILE
  242. else
  243. protoc -I$PROTO_DIR --java_out=$JAVA_DIR $PROTO_FILE
  244. fi
  245. done
  246. </echo>
  247. <exec executable="sh" dir="${basedir}" failonerror="true">
  248. <arg line="target/compile-proto.sh"/>
  249. </exec>
  250. </target>
  251. </configuration>
  252. </execution>
  253. <execution>
  254. <id>create-web-xmls</id>
  255. <phase>compile</phase>
  256. <goals>
  257. <goal>run</goal>
  258. </goals>
  259. <configuration>
  260. <target>
  261. <loadfile property="hdfs.servlet.definitions" srcFile="${project.build.directory}/hdfs-jsp-servlet-definitions.xml"/>
  262. <loadfile property="secondary.servlet.definitions" srcFile="${project.build.directory}/secondary-jsp-servlet-definitions.xml"/>
  263. <loadfile property="datanode.servlet.definitions" srcFile="${project.build.directory}/datanode-jsp-servlet-definitions.xml"/>
  264. <echoproperties destfile="${project.build.directory}/webxml.properties">
  265. <propertyset>
  266. <propertyref regex=".*.servlet.definitions"/>
  267. </propertyset>
  268. </echoproperties>
  269. <filter filtersfile="${project.build.directory}/webxml.properties"/>
  270. <copy file="${basedir}/src/main/webapps/proto-hdfs-web.xml"
  271. tofile="${project.build.directory}/webapps/hdfs/WEB-INF/web.xml"
  272. filtering="true"/>
  273. <copy file="${basedir}/src/main/webapps/proto-secondary-web.xml"
  274. tofile="${project.build.directory}/webapps/secondary/WEB-INF/web.xml"
  275. filtering="true"/>
  276. <copy file="${basedir}/src/main/webapps/proto-datanode-web.xml"
  277. tofile="${project.build.directory}/webapps/datanode/WEB-INF/web.xml"
  278. filtering="true"/>
  279. <copy toDir="${project.build.directory}/webapps">
  280. <fileset dir="${basedir}/src/main/webapps">
  281. <exclude name="**/*.jsp"/>
  282. <exclude name="**/proto-*-web.xml"/>
  283. </fileset>
  284. </copy>
  285. </target>
  286. </configuration>
  287. </execution>
  288. <execution>
  289. <id>create-log-dir</id>
  290. <phase>process-test-resources</phase>
  291. <goals>
  292. <goal>run</goal>
  293. </goals>
  294. <configuration>
  295. <target>
  296. <delete dir="${test.build.data}"/>
  297. <mkdir dir="${test.build.data}"/>
  298. <mkdir dir="${hadoop.log.dir}"/>
  299. <copy todir="${project.build.directory}/test-classes/webapps">
  300. <fileset dir="${project.build.directory}/webapps">
  301. <exclude name="proto-*-web.xml"/>
  302. </fileset>
  303. </copy>
  304. </target>
  305. </configuration>
  306. </execution>
  307. <execution>
  308. <phase>pre-site</phase>
  309. <goals>
  310. <goal>run</goal>
  311. </goals>
  312. <configuration>
  313. <tasks>
  314. <copy file="src/main/resources/hdfs-default.xml" todir="src/site/resources"/>
  315. <copy file="src/main/xsl/configuration.xsl" todir="src/site/resources"/>
  316. </tasks>
  317. </configuration>
  318. </execution>
  319. </executions>
  320. </plugin>
  321. <plugin>
  322. <groupId>org.apache.rat</groupId>
  323. <artifactId>apache-rat-plugin</artifactId>
  324. <configuration>
  325. <excludes>
  326. <exclude>CHANGES.txt</exclude>
  327. <exclude>CHANGES.HDFS-1623.txt</exclude>
  328. <exclude>.idea/**</exclude>
  329. <exclude>src/main/conf/*</exclude>
  330. <exclude>src/main/docs/**</exclude>
  331. <exclude>dev-support/findbugsExcludeFile.xml</exclude>
  332. <exclude>dev-support/checkstyle*</exclude>
  333. <exclude>dev-support/jdiff/**</exclude>
  334. <exclude>dev-support/*tests</exclude>
  335. <exclude>src/main/native/*</exclude>
  336. <exclude>src/main/native/config/*</exclude>
  337. <exclude>src/main/native/m4/*</exclude>
  338. <exclude>src/test/empty-file</exclude>
  339. <exclude>src/test/all-tests</exclude>
  340. <exclude>src/test/resources/*.tgz</exclude>
  341. <exclude>src/test/resources/data*</exclude>
  342. <exclude>src/test/resources/editsStored*</exclude>
  343. <exclude>src/test/resources/empty-file</exclude>
  344. <exclude>src/main/webapps/datanode/robots.txt</exclude>
  345. <exclude>src/main/docs/releasenotes.html</exclude>
  346. <exclude>src/contrib/**</exclude>
  347. </excludes>
  348. </configuration>
  349. </plugin>
  350. <plugin>
  351. <groupId>org.apache.maven.plugins</groupId>
  352. <artifactId>maven-antrun-plugin</artifactId>
  353. <executions>
  354. <execution>
  355. <id>xprepare-package-hadoop-daemon</id>
  356. <phase>prepare-package</phase>
  357. <goals>
  358. <goal>run</goal>
  359. </goals>
  360. <configuration>
  361. <target unless="windows.build">
  362. <condition property="commons.daemon.os.name" value="darwin">
  363. <os name="Mac OS X"/>
  364. </condition>
  365. <condition property="commons.daemon.os.arch" value="universal">
  366. <os name="Mac OS X"/>
  367. </condition>
  368. <condition property="commons.daemon.os.name" value="linux">
  369. <os name="Linux" />
  370. </condition>
  371. <!-- Set commons.daemon.os.arch to either i686 or x86_64 for GNU/Linux -->
  372. <condition property="commons.daemon.os.arch" value="x86_64">
  373. <os name="Linux" arch="amd64"/>
  374. </condition>
  375. <condition property="commons.daemon.os.arch" value="i686">
  376. <os name="Linux" /> <!-- This is a guess -->
  377. </condition>
  378. <property name="commons.daemon.tar.name"
  379. value="commons-daemon-${commons-daemon.version}-bin-${commons.daemon.os.name}-${commons.daemon.os.arch}.tar.gz"/>
  380. <mkdir dir="downloads"/>
  381. <get src="http://archive.apache.org/dist/commons/daemon/binaries/${commons-daemon.version}/${commons.daemon.os.name}/${commons.daemon.tar.name}"
  382. dest="downloads/${commons.daemon.tar.name}" verbose="true" skipexisting="true"/>
  383. <delete dir="${project.build.directory}/commons-daemon.staging"/>
  384. <mkdir dir="${project.build.directory}/commons-daemon.staging"/>
  385. <untar compression="gzip" src="${basedir}/downloads/${commons.daemon.tar.name}"
  386. dest="${project.build.directory}/commons-daemon.staging"/>
  387. <copy file="${project.build.directory}/commons-daemon.staging/jsvc"
  388. todir="${project.build.directory}/${project.artifactId}-${project.version}/libexec"
  389. verbose="true"/>
  390. <chmod perm="ugo+x" type="file">
  391. <fileset file="${project.build.directory}/${project.artifactId}-${project.version}/libexec/jsvc"/>
  392. </chmod>
  393. </target>
  394. </configuration>
  395. </execution>
  396. </executions>
  397. </plugin>
  398. </plugins>
  399. </build>
  400. <profiles>
  401. <profile>
  402. <id>windows</id>
  403. <activation>
  404. <activeByDefault>false</activeByDefault>
  405. <os>
  406. <family>windows</family>
  407. </os>
  408. </activation>
  409. <properties>
  410. <windows.build>true</windows.build>
  411. </properties>
  412. </profile>
  413. <profile>
  414. <id>native</id>
  415. <activation>
  416. <activeByDefault>false</activeByDefault>
  417. </activation>
  418. <build>
  419. <plugins>
  420. <plugin>
  421. <groupId>org.apache.maven.plugins</groupId>
  422. <artifactId>maven-antrun-plugin</artifactId>
  423. <executions>
  424. <execution>
  425. <id>compile</id>
  426. <phase>compile</phase>
  427. <goals>
  428. <goal>run</goal>
  429. </goals>
  430. <configuration>
  431. <target>
  432. <copy toDir="${project.build.directory}/native">
  433. <fileset dir="${basedir}/src/main/native"/>
  434. </copy>
  435. <mkdir dir="${project.build.directory}/native/m4"/>
  436. </target>
  437. </configuration>
  438. </execution>
  439. </executions>
  440. </plugin>
  441. <plugin>
  442. <groupId>org.codehaus.mojo</groupId>
  443. <artifactId>make-maven-plugin</artifactId>
  444. <executions>
  445. <execution>
  446. <id>compile</id>
  447. <phase>compile</phase>
  448. <goals>
  449. <goal>autoreconf</goal>
  450. <goal>configure</goal>
  451. <goal>make-install</goal>
  452. </goals>
  453. <configuration>
  454. <!-- autoreconf settings -->
  455. <workDir>${project.build.directory}/native</workDir>
  456. <arguments>
  457. <argument>-i</argument>
  458. <argument>-f</argument>
  459. </arguments>
  460. <!-- configure settings -->
  461. <configureEnvironment>
  462. <property>
  463. <name>ac_cv_func_malloc_0_nonnull</name>
  464. <value>yes</value>
  465. </property>
  466. <property>
  467. <name>JVM_ARCH</name>
  468. <value>${sun.arch.data.model}</value>
  469. </property>
  470. </configureEnvironment>
  471. <configureOptions>
  472. </configureOptions>
  473. <configureWorkDir>${project.build.directory}/native</configureWorkDir>
  474. <prefix>/usr/local</prefix>
  475. <!-- make settings -->
  476. <installEnvironment>
  477. <property>
  478. <name>ac_cv_func_malloc_0_nonnull</name>
  479. <value>yes</value>
  480. </property>
  481. <property>
  482. <name>JVM_ARCH</name>
  483. <value>${sun.arch.data.model}</value>
  484. </property>
  485. </installEnvironment>
  486. <!-- configure & make settings -->
  487. <destDir>${project.build.directory}/native/target</destDir>
  488. </configuration>
  489. </execution>
  490. <!-- TODO wire here native testcases
  491. <execution>
  492. <id>test</id>
  493. <phase>test</phase>
  494. <goals>
  495. <goal>test</goal>
  496. </goals>
  497. <configuration>
  498. <destDir>${project.build.directory}/native/target</destDir>
  499. </configuration>
  500. </execution>
  501. -->
  502. </executions>
  503. </plugin>
  504. </plugins>
  505. </build>
  506. </profile>
  507. </profiles>
  508. </project>