pom.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  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. <require.fuse>false</require.fuse>
  34. </properties>
  35. <dependencies>
  36. <dependency>
  37. <groupId>org.aspectj</groupId>
  38. <artifactId>aspectjtools</artifactId>
  39. <scope>test</scope>
  40. </dependency>
  41. <dependency>
  42. <groupId>org.aspectj</groupId>
  43. <artifactId>aspectjrt</artifactId>
  44. <scope>test</scope>
  45. </dependency>
  46. <dependency>
  47. <groupId>org.apache.hadoop</groupId>
  48. <artifactId>hadoop-annotations</artifactId>
  49. <scope>provided</scope>
  50. </dependency>
  51. <dependency>
  52. <groupId>org.apache.hadoop</groupId>
  53. <artifactId>hadoop-common</artifactId>
  54. <scope>provided</scope>
  55. </dependency>
  56. <dependency>
  57. <groupId>org.apache.hadoop</groupId>
  58. <artifactId>hadoop-common</artifactId>
  59. <scope>test</scope>
  60. <type>test-jar</type>
  61. </dependency>
  62. <dependency>
  63. <groupId>commons-logging</groupId>
  64. <artifactId>commons-logging</artifactId>
  65. <scope>compile</scope>
  66. </dependency>
  67. <dependency>
  68. <groupId>commons-daemon</groupId>
  69. <artifactId>commons-daemon</artifactId>
  70. <scope>compile</scope>
  71. </dependency>
  72. <dependency>
  73. <groupId>log4j</groupId>
  74. <artifactId>log4j</artifactId>
  75. <scope>compile</scope>
  76. </dependency>
  77. <dependency>
  78. <groupId>com.google.protobuf</groupId>
  79. <artifactId>protobuf-java</artifactId>
  80. <scope>compile</scope>
  81. </dependency>
  82. <dependency>
  83. <groupId>org.apache.avro</groupId>
  84. <artifactId>avro</artifactId>
  85. <scope>compile</scope>
  86. </dependency>
  87. <dependency>
  88. <groupId>junit</groupId>
  89. <artifactId>junit</artifactId>
  90. <scope>test</scope>
  91. </dependency>
  92. <dependency>
  93. <groupId>org.mockito</groupId>
  94. <artifactId>mockito-all</artifactId>
  95. <scope>test</scope>
  96. </dependency>
  97. <dependency>
  98. <groupId>org.apache.ant</groupId>
  99. <artifactId>ant</artifactId>
  100. <scope>provided</scope>
  101. </dependency>
  102. <dependency>
  103. <groupId>org.apache.zookeeper</groupId>
  104. <artifactId>zookeeper</artifactId>
  105. <version>3.4.2</version>
  106. <scope>provided</scope>
  107. </dependency>
  108. <dependency>
  109. <groupId>org.slf4j</groupId>
  110. <artifactId>slf4j-log4j12</artifactId>
  111. <scope>provided</scope>
  112. </dependency>
  113. <dependency>
  114. <groupId>org.apache.zookeeper</groupId>
  115. <artifactId>zookeeper</artifactId>
  116. <version>3.4.2</version>
  117. <type>test-jar</type>
  118. <scope>test</scope>
  119. </dependency>
  120. </dependencies>
  121. <build>
  122. <plugins>
  123. <plugin>
  124. <groupId>org.codehaus.mojo.jspc</groupId>
  125. <artifactId>jspc-maven-plugin</artifactId>
  126. <executions>
  127. <execution>
  128. <id>hdfs</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}/hdfs-jsp-servlet-definitions.xml</webFragmentFile>
  137. <packageName>org.apache.hadoop.hdfs.server.namenode</packageName>
  138. <sources>
  139. <directory>${basedir}/src/main/webapps/hdfs</directory>
  140. <includes>
  141. <include>*.jsp</include>
  142. </includes>
  143. </sources>
  144. </configuration>
  145. </execution>
  146. <execution>
  147. <id>secondary</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}/secondary-jsp-servlet-definitions.xml</webFragmentFile>
  156. <packageName>org.apache.hadoop.hdfs.server.namenode</packageName>
  157. <sources>
  158. <directory>${basedir}/src/main/webapps/secondary</directory>
  159. <includes>
  160. <include>*.jsp</include>
  161. </includes>
  162. </sources>
  163. </configuration>
  164. </execution>
  165. <execution>
  166. <id>datanode</id>
  167. <phase>generate-sources</phase>
  168. <goals>
  169. <goal>compile</goal>
  170. </goals>
  171. <configuration>
  172. <compile>false</compile>
  173. <workingDirectory>${project.build.directory}/generated-src/main/jsp</workingDirectory>
  174. <webFragmentFile>${project.build.directory}/datanode-jsp-servlet-definitions.xml</webFragmentFile>
  175. <packageName>org.apache.hadoop.hdfs.server.datanode</packageName>
  176. <sources>
  177. <directory>${basedir}/src/main/webapps/datanode</directory>
  178. <includes>
  179. <include>*.jsp</include>
  180. </includes>
  181. </sources>
  182. </configuration>
  183. </execution>
  184. </executions>
  185. <dependencies>
  186. <dependency>
  187. <groupId>org.codehaus.mojo.jspc</groupId>
  188. <artifactId>jspc-compiler-tomcat5</artifactId>
  189. <version>2.0-alpha-3</version>
  190. </dependency>
  191. <dependency>
  192. <groupId>org.slf4j</groupId>
  193. <artifactId>slf4j-log4j12</artifactId>
  194. <version>1.4.1</version>
  195. </dependency>
  196. <dependency>
  197. <groupId>org.slf4j</groupId>
  198. <artifactId>jcl104-over-slf4j</artifactId>
  199. <version>1.4.1</version>
  200. </dependency>
  201. </dependencies>
  202. </plugin>
  203. <plugin>
  204. <groupId>org.codehaus.mojo</groupId>
  205. <artifactId>build-helper-maven-plugin</artifactId>
  206. <executions>
  207. <execution>
  208. <id>add-source</id>
  209. <phase>generate-sources</phase>
  210. <goals>
  211. <goal>add-source</goal>
  212. </goals>
  213. <configuration>
  214. <sources>
  215. <source>${project.build.directory}/generated-sources/java</source>
  216. <source>${project.build.directory}/generated-src/main/jsp</source>
  217. </sources>
  218. </configuration>
  219. </execution>
  220. </executions>
  221. </plugin>
  222. <plugin>
  223. <groupId>org.apache.maven.plugins</groupId>
  224. <artifactId>maven-antrun-plugin</artifactId>
  225. <executions>
  226. <execution>
  227. <id>compile-proto</id>
  228. <phase>generate-sources</phase>
  229. <goals>
  230. <goal>run</goal>
  231. </goals>
  232. <configuration>
  233. <target>
  234. <echo file="target/compile-proto.sh">
  235. PROTO_DIR=src/main/proto
  236. JAVA_DIR=target/generated-sources/java
  237. which cygpath 2&gt; /dev/null
  238. if [ $? = 1 ]; then
  239. IS_WIN=false
  240. else
  241. IS_WIN=true
  242. WIN_PROTO_DIR=`cygpath --windows $PROTO_DIR`
  243. WIN_JAVA_DIR=`cygpath --windows $JAVA_DIR`
  244. fi
  245. mkdir -p $JAVA_DIR 2&gt; /dev/null
  246. for PROTO_FILE in `ls $PROTO_DIR/*.proto 2&gt; /dev/null`
  247. do
  248. if [ "$IS_WIN" = "true" ]; then
  249. protoc -I$WIN_PROTO_DIR --java_out=$WIN_JAVA_DIR $PROTO_FILE
  250. else
  251. protoc -I$PROTO_DIR --java_out=$JAVA_DIR $PROTO_FILE
  252. fi
  253. done
  254. </echo>
  255. <exec executable="sh" dir="${basedir}" failonerror="true">
  256. <arg line="target/compile-proto.sh"/>
  257. </exec>
  258. </target>
  259. </configuration>
  260. </execution>
  261. <execution>
  262. <id>create-web-xmls</id>
  263. <phase>compile</phase>
  264. <goals>
  265. <goal>run</goal>
  266. </goals>
  267. <configuration>
  268. <target>
  269. <loadfile property="hdfs.servlet.definitions" srcFile="${project.build.directory}/hdfs-jsp-servlet-definitions.xml"/>
  270. <loadfile property="secondary.servlet.definitions" srcFile="${project.build.directory}/secondary-jsp-servlet-definitions.xml"/>
  271. <loadfile property="datanode.servlet.definitions" srcFile="${project.build.directory}/datanode-jsp-servlet-definitions.xml"/>
  272. <echoproperties destfile="${project.build.directory}/webxml.properties">
  273. <propertyset>
  274. <propertyref regex=".*.servlet.definitions"/>
  275. </propertyset>
  276. </echoproperties>
  277. <filter filtersfile="${project.build.directory}/webxml.properties"/>
  278. <copy file="${basedir}/src/main/webapps/proto-hdfs-web.xml"
  279. tofile="${project.build.directory}/webapps/hdfs/WEB-INF/web.xml"
  280. filtering="true"/>
  281. <copy file="${basedir}/src/main/webapps/proto-secondary-web.xml"
  282. tofile="${project.build.directory}/webapps/secondary/WEB-INF/web.xml"
  283. filtering="true"/>
  284. <copy file="${basedir}/src/main/webapps/proto-datanode-web.xml"
  285. tofile="${project.build.directory}/webapps/datanode/WEB-INF/web.xml"
  286. filtering="true"/>
  287. <copy toDir="${project.build.directory}/webapps">
  288. <fileset dir="${basedir}/src/main/webapps">
  289. <exclude name="**/*.jsp"/>
  290. <exclude name="**/proto-*-web.xml"/>
  291. </fileset>
  292. </copy>
  293. </target>
  294. </configuration>
  295. </execution>
  296. <execution>
  297. <id>create-log-dir</id>
  298. <phase>process-test-resources</phase>
  299. <goals>
  300. <goal>run</goal>
  301. </goals>
  302. <configuration>
  303. <target>
  304. <delete dir="${test.build.data}"/>
  305. <mkdir dir="${test.build.data}"/>
  306. <mkdir dir="${hadoop.log.dir}"/>
  307. <copy todir="${project.build.directory}/test-classes/webapps">
  308. <fileset dir="${project.build.directory}/webapps">
  309. <exclude name="proto-*-web.xml"/>
  310. </fileset>
  311. </copy>
  312. </target>
  313. </configuration>
  314. </execution>
  315. <execution>
  316. <phase>pre-site</phase>
  317. <goals>
  318. <goal>run</goal>
  319. </goals>
  320. <configuration>
  321. <tasks>
  322. <copy file="src/main/resources/hdfs-default.xml" todir="src/site/resources"/>
  323. <copy file="src/main/xsl/configuration.xsl" todir="src/site/resources"/>
  324. </tasks>
  325. </configuration>
  326. </execution>
  327. </executions>
  328. </plugin>
  329. <plugin>
  330. <groupId>org.apache.maven.plugins</groupId>
  331. <artifactId>maven-javadoc-plugin</artifactId>
  332. <configuration>
  333. <excludePackageNames>org.apache.hadoop.hdfs.protocol.proto</excludePackageNames>
  334. </configuration>
  335. </plugin>
  336. <plugin>
  337. <groupId>org.apache.rat</groupId>
  338. <artifactId>apache-rat-plugin</artifactId>
  339. <configuration>
  340. <excludes>
  341. <exclude>CHANGES.txt</exclude>
  342. <exclude>CHANGES.HDFS-1623.txt</exclude>
  343. <exclude>.idea/**</exclude>
  344. <exclude>src/main/conf/*</exclude>
  345. <exclude>src/main/docs/**</exclude>
  346. <exclude>dev-support/findbugsExcludeFile.xml</exclude>
  347. <exclude>dev-support/checkstyle*</exclude>
  348. <exclude>dev-support/jdiff/**</exclude>
  349. <exclude>dev-support/*tests</exclude>
  350. <exclude>src/main/native/*</exclude>
  351. <exclude>src/main/native/config/*</exclude>
  352. <exclude>src/main/native/m4/*</exclude>
  353. <exclude>src/test/empty-file</exclude>
  354. <exclude>src/test/all-tests</exclude>
  355. <exclude>src/test/resources/*.tgz</exclude>
  356. <exclude>src/test/resources/data*</exclude>
  357. <exclude>src/test/resources/editsStored*</exclude>
  358. <exclude>src/test/resources/empty-file</exclude>
  359. <exclude>src/main/webapps/datanode/robots.txt</exclude>
  360. <exclude>src/main/docs/releasenotes.html</exclude>
  361. <exclude>src/contrib/**</exclude>
  362. </excludes>
  363. </configuration>
  364. </plugin>
  365. </plugins>
  366. </build>
  367. <profiles>
  368. <profile>
  369. <id>windows</id>
  370. <activation>
  371. <activeByDefault>false</activeByDefault>
  372. <os>
  373. <family>windows</family>
  374. </os>
  375. </activation>
  376. <properties>
  377. <windows.build>true</windows.build>
  378. </properties>
  379. </profile>
  380. <profile>
  381. <id>native</id>
  382. <activation>
  383. <activeByDefault>false</activeByDefault>
  384. </activation>
  385. <build>
  386. <plugins>
  387. <plugin>
  388. <groupId>org.apache.maven.plugins</groupId>
  389. <artifactId>maven-antrun-plugin</artifactId>
  390. <executions>
  391. <execution>
  392. <id>make</id>
  393. <phase>compile</phase>
  394. <goals><goal>run</goal></goals>
  395. <configuration>
  396. <target>
  397. <mkdir dir="${project.build.directory}/native"/>
  398. <exec executable="cmake" dir="${project.build.directory}/native"
  399. failonerror="true">
  400. <arg line="${basedir}/src/ -DGENERATED_JAVAH=${project.build.directory}/native/javah -DJVM_ARCH_DATA_MODEL=${sun.arch.data.model} -DREQUIRE_FUSE=${require.fuse}"/>
  401. </exec>
  402. <exec executable="make" dir="${project.build.directory}/native" failonerror="true">
  403. <arg line="VERBOSE=1"/>
  404. </exec>
  405. </target>
  406. </configuration>
  407. </execution>
  408. <execution>
  409. <id>native_tests</id>
  410. <phase>test</phase>
  411. <goals><goal>run</goal></goals>
  412. <configuration>
  413. <target>
  414. <property name="compile_classpath" refid="maven.compile.classpath"/>
  415. <property name="test_classpath" refid="maven.test.classpath"/>
  416. <exec executable="${project.build.directory}/native/test_libhdfs_threaded" dir="${project.build.directory}/native/" failonerror="true">
  417. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  418. </exec>
  419. <exec executable="${project.build.directory}/native/test_native_mini_dfs" dir="${project.build.directory}/native/" failonerror="true">
  420. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  421. </exec>
  422. </target>
  423. </configuration>
  424. </execution>
  425. </executions>
  426. </plugin>
  427. </plugins>
  428. </build>
  429. </profile>
  430. </profiles>
  431. </project>