pom.xml 20 KB

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