pom.xml 20 KB

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