pom.xml 19 KB

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