pom.xml 18 KB

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