pom.xml 19 KB

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