pom.xml 16 KB

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