pom.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  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>3.0.0-SNAPSHOT</version>
  22. <relativePath>../../hadoop-project-dist</relativePath>
  23. </parent>
  24. <groupId>org.apache.hadoop</groupId>
  25. <artifactId>hadoop-hdfs</artifactId>
  26. <version>3.0.0-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. <kdc.resource.dir>../../hadoop-common-project/hadoop-common/src/test/resources/kdc</kdc.resource.dir>
  33. <is.hadoop.component>true</is.hadoop.component>
  34. <require.fuse>false</require.fuse>
  35. </properties>
  36. <dependencies>
  37. <dependency>
  38. <groupId>org.aspectj</groupId>
  39. <artifactId>aspectjtools</artifactId>
  40. <scope>test</scope>
  41. </dependency>
  42. <dependency>
  43. <groupId>org.aspectj</groupId>
  44. <artifactId>aspectjrt</artifactId>
  45. <scope>test</scope>
  46. </dependency>
  47. <dependency>
  48. <groupId>org.apache.hadoop</groupId>
  49. <artifactId>hadoop-annotations</artifactId>
  50. <scope>provided</scope>
  51. </dependency>
  52. <dependency>
  53. <groupId>org.apache.hadoop</groupId>
  54. <artifactId>hadoop-common</artifactId>
  55. <scope>provided</scope>
  56. </dependency>
  57. <dependency>
  58. <groupId>org.apache.hadoop</groupId>
  59. <artifactId>hadoop-common</artifactId>
  60. <scope>test</scope>
  61. <type>test-jar</type>
  62. </dependency>
  63. <dependency>
  64. <groupId>commons-logging</groupId>
  65. <artifactId>commons-logging</artifactId>
  66. <scope>compile</scope>
  67. </dependency>
  68. <dependency>
  69. <groupId>commons-daemon</groupId>
  70. <artifactId>commons-daemon</artifactId>
  71. <scope>compile</scope>
  72. </dependency>
  73. <dependency>
  74. <groupId>log4j</groupId>
  75. <artifactId>log4j</artifactId>
  76. <scope>compile</scope>
  77. </dependency>
  78. <dependency>
  79. <groupId>com.google.protobuf</groupId>
  80. <artifactId>protobuf-java</artifactId>
  81. <scope>compile</scope>
  82. </dependency>
  83. <dependency>
  84. <groupId>org.apache.avro</groupId>
  85. <artifactId>avro</artifactId>
  86. <scope>compile</scope>
  87. </dependency>
  88. <dependency>
  89. <groupId>junit</groupId>
  90. <artifactId>junit</artifactId>
  91. <scope>test</scope>
  92. </dependency>
  93. <dependency>
  94. <groupId>org.mockito</groupId>
  95. <artifactId>mockito-all</artifactId>
  96. <scope>test</scope>
  97. </dependency>
  98. <dependency>
  99. <groupId>org.apache.ant</groupId>
  100. <artifactId>ant</artifactId>
  101. <scope>provided</scope>
  102. </dependency>
  103. <dependency>
  104. <groupId>org.apache.zookeeper</groupId>
  105. <artifactId>zookeeper</artifactId>
  106. <version>3.4.2</version>
  107. <scope>provided</scope>
  108. </dependency>
  109. <dependency>
  110. <groupId>org.slf4j</groupId>
  111. <artifactId>slf4j-log4j12</artifactId>
  112. <scope>provided</scope>
  113. </dependency>
  114. <dependency>
  115. <groupId>org.apache.zookeeper</groupId>
  116. <artifactId>zookeeper</artifactId>
  117. <version>3.4.2</version>
  118. <type>test-jar</type>
  119. <scope>test</scope>
  120. </dependency>
  121. </dependencies>
  122. <build>
  123. <plugins>
  124. <plugin>
  125. <groupId>org.apache.maven.plugins</groupId>
  126. <artifactId>maven-surefire-plugin</artifactId>
  127. <configuration>
  128. <systemPropertyVariables>
  129. <startKdc>${startKdc}</startKdc>
  130. <kdc.resource.dir>${kdc.resource.dir}</kdc.resource.dir>
  131. </systemPropertyVariables>
  132. </configuration>
  133. </plugin>
  134. <plugin>
  135. <groupId>org.codehaus.mojo.jspc</groupId>
  136. <artifactId>jspc-maven-plugin</artifactId>
  137. <executions>
  138. <execution>
  139. <id>hdfs</id>
  140. <phase>generate-sources</phase>
  141. <goals>
  142. <goal>compile</goal>
  143. </goals>
  144. <configuration>
  145. <compile>false</compile>
  146. <workingDirectory>${project.build.directory}/generated-src/main/jsp</workingDirectory>
  147. <webFragmentFile>${project.build.directory}/hdfs-jsp-servlet-definitions.xml</webFragmentFile>
  148. <packageName>org.apache.hadoop.hdfs.server.namenode</packageName>
  149. <sources>
  150. <directory>${basedir}/src/main/webapps/hdfs</directory>
  151. <includes>
  152. <include>*.jsp</include>
  153. </includes>
  154. </sources>
  155. </configuration>
  156. </execution>
  157. <execution>
  158. <id>secondary</id>
  159. <phase>generate-sources</phase>
  160. <goals>
  161. <goal>compile</goal>
  162. </goals>
  163. <configuration>
  164. <compile>false</compile>
  165. <workingDirectory>${project.build.directory}/generated-src/main/jsp</workingDirectory>
  166. <webFragmentFile>${project.build.directory}/secondary-jsp-servlet-definitions.xml</webFragmentFile>
  167. <packageName>org.apache.hadoop.hdfs.server.namenode</packageName>
  168. <sources>
  169. <directory>${basedir}/src/main/webapps/secondary</directory>
  170. <includes>
  171. <include>*.jsp</include>
  172. </includes>
  173. </sources>
  174. </configuration>
  175. </execution>
  176. <execution>
  177. <id>journal</id>
  178. <phase>generate-sources</phase>
  179. <goals>
  180. <goal>compile</goal>
  181. </goals>
  182. <configuration>
  183. <compile>false</compile>
  184. <workingDirectory>${project.build.directory}/generated-src/main/jsp</workingDirectory>
  185. <webFragmentFile>${project.build.directory}/journal-jsp-servlet-definitions.xml</webFragmentFile>
  186. <packageName>org.apache.hadoop.hdfs.server.journalservice</packageName>
  187. <sources>
  188. <directory>${basedir}/src/main/webapps/journal</directory>
  189. <includes>
  190. <include>*.jsp</include>
  191. </includes>
  192. </sources>
  193. </configuration>
  194. </execution>
  195. <execution>
  196. <id>datanode</id>
  197. <phase>generate-sources</phase>
  198. <goals>
  199. <goal>compile</goal>
  200. </goals>
  201. <configuration>
  202. <compile>false</compile>
  203. <workingDirectory>${project.build.directory}/generated-src/main/jsp</workingDirectory>
  204. <webFragmentFile>${project.build.directory}/datanode-jsp-servlet-definitions.xml</webFragmentFile>
  205. <packageName>org.apache.hadoop.hdfs.server.datanode</packageName>
  206. <sources>
  207. <directory>${basedir}/src/main/webapps/datanode</directory>
  208. <includes>
  209. <include>*.jsp</include>
  210. </includes>
  211. </sources>
  212. </configuration>
  213. </execution>
  214. </executions>
  215. <dependencies>
  216. <dependency>
  217. <groupId>org.codehaus.mojo.jspc</groupId>
  218. <artifactId>jspc-compiler-tomcat5</artifactId>
  219. <version>2.0-alpha-3</version>
  220. </dependency>
  221. <dependency>
  222. <groupId>org.slf4j</groupId>
  223. <artifactId>slf4j-log4j12</artifactId>
  224. <version>1.4.1</version>
  225. </dependency>
  226. <dependency>
  227. <groupId>org.slf4j</groupId>
  228. <artifactId>jcl104-over-slf4j</artifactId>
  229. <version>1.4.1</version>
  230. </dependency>
  231. </dependencies>
  232. </plugin>
  233. <plugin>
  234. <groupId>org.codehaus.mojo</groupId>
  235. <artifactId>build-helper-maven-plugin</artifactId>
  236. <executions>
  237. <execution>
  238. <id>add-source</id>
  239. <phase>generate-sources</phase>
  240. <goals>
  241. <goal>add-source</goal>
  242. </goals>
  243. <configuration>
  244. <sources>
  245. <source>${project.build.directory}/generated-sources/java</source>
  246. <source>${project.build.directory}/generated-src/main/jsp</source>
  247. </sources>
  248. </configuration>
  249. </execution>
  250. </executions>
  251. </plugin>
  252. <plugin>
  253. <groupId>org.apache.maven.plugins</groupId>
  254. <artifactId>maven-antrun-plugin</artifactId>
  255. <configuration>
  256. <skipTests>false</skipTests>
  257. </configuration>
  258. <executions>
  259. <execution>
  260. <id>compile-proto</id>
  261. <phase>generate-sources</phase>
  262. <goals>
  263. <goal>run</goal>
  264. </goals>
  265. <configuration>
  266. <target>
  267. <echo file="target/compile-proto.sh">
  268. PROTO_DIR=src/main/proto
  269. JAVA_DIR=target/generated-sources/java
  270. which cygpath 2&gt; /dev/null
  271. if [ $? = 1 ]; then
  272. IS_WIN=false
  273. else
  274. IS_WIN=true
  275. WIN_PROTO_DIR=`cygpath --windows $PROTO_DIR`
  276. WIN_JAVA_DIR=`cygpath --windows $JAVA_DIR`
  277. fi
  278. mkdir -p $JAVA_DIR 2&gt; /dev/null
  279. for PROTO_FILE in `ls $PROTO_DIR/*.proto 2&gt; /dev/null`
  280. do
  281. if [ "$IS_WIN" = "true" ]; then
  282. protoc -I$WIN_PROTO_DIR --java_out=$WIN_JAVA_DIR $PROTO_FILE
  283. else
  284. protoc -I$PROTO_DIR --java_out=$JAVA_DIR $PROTO_FILE
  285. fi
  286. done
  287. </echo>
  288. <exec executable="sh" dir="${basedir}" failonerror="true">
  289. <arg line="target/compile-proto.sh"/>
  290. </exec>
  291. </target>
  292. </configuration>
  293. </execution>
  294. <execution>
  295. <id>create-web-xmls</id>
  296. <phase>compile</phase>
  297. <goals>
  298. <goal>run</goal>
  299. </goals>
  300. <configuration>
  301. <target>
  302. <loadfile property="hdfs.servlet.definitions" srcFile="${project.build.directory}/hdfs-jsp-servlet-definitions.xml"/>
  303. <loadfile property="secondary.servlet.definitions" srcFile="${project.build.directory}/secondary-jsp-servlet-definitions.xml"/>
  304. <loadfile property="datanode.servlet.definitions" srcFile="${project.build.directory}/datanode-jsp-servlet-definitions.xml"/>
  305. <loadfile property="journal.servlet.definitions" srcFile="${project.build.directory}/journal-jsp-servlet-definitions.xml"/>
  306. <echoproperties destfile="${project.build.directory}/webxml.properties">
  307. <propertyset>
  308. <propertyref regex=".*.servlet.definitions"/>
  309. </propertyset>
  310. </echoproperties>
  311. <filter filtersfile="${project.build.directory}/webxml.properties"/>
  312. <copy file="${basedir}/src/main/webapps/proto-hdfs-web.xml"
  313. tofile="${project.build.directory}/webapps/hdfs/WEB-INF/web.xml"
  314. filtering="true"/>
  315. <copy file="${basedir}/src/main/webapps/proto-secondary-web.xml"
  316. tofile="${project.build.directory}/webapps/secondary/WEB-INF/web.xml"
  317. filtering="true"/>
  318. <copy file="${basedir}/src/main/webapps/proto-datanode-web.xml"
  319. tofile="${project.build.directory}/webapps/datanode/WEB-INF/web.xml"
  320. filtering="true"/>
  321. <copy file="${basedir}/src/main/webapps/proto-journal-web.xml"
  322. tofile="${project.build.directory}/webapps/journal/WEB-INF/web.xml"
  323. filtering="true"/>
  324. <copy toDir="${project.build.directory}/webapps">
  325. <fileset dir="${basedir}/src/main/webapps">
  326. <exclude name="**/*.jsp"/>
  327. <exclude name="**/proto-*-web.xml"/>
  328. </fileset>
  329. </copy>
  330. </target>
  331. </configuration>
  332. </execution>
  333. <execution>
  334. <id>create-log-dir</id>
  335. <phase>process-test-resources</phase>
  336. <goals>
  337. <goal>run</goal>
  338. </goals>
  339. <configuration>
  340. <target>
  341. <delete dir="${test.build.data}"/>
  342. <mkdir dir="${test.build.data}"/>
  343. <mkdir dir="${hadoop.log.dir}"/>
  344. <copy todir="${project.build.directory}/test-classes/webapps">
  345. <fileset dir="${project.build.directory}/webapps">
  346. <exclude name="proto-*-web.xml"/>
  347. </fileset>
  348. </copy>
  349. </target>
  350. </configuration>
  351. </execution>
  352. <execution>
  353. <phase>pre-site</phase>
  354. <goals>
  355. <goal>run</goal>
  356. </goals>
  357. <configuration>
  358. <tasks>
  359. <copy file="src/main/resources/hdfs-default.xml" todir="src/site/resources"/>
  360. <copy file="src/main/xsl/configuration.xsl" todir="src/site/resources"/>
  361. </tasks>
  362. </configuration>
  363. </execution>
  364. </executions>
  365. </plugin>
  366. <plugin>
  367. <groupId>org.apache.maven.plugins</groupId>
  368. <artifactId>maven-javadoc-plugin</artifactId>
  369. <configuration>
  370. <excludePackageNames>org.apache.hadoop.hdfs.protocol.proto</excludePackageNames>
  371. </configuration>
  372. </plugin>
  373. <plugin>
  374. <groupId>org.apache.rat</groupId>
  375. <artifactId>apache-rat-plugin</artifactId>
  376. <configuration>
  377. <excludes>
  378. <exclude>CHANGES.txt</exclude>
  379. <exclude>CHANGES.HDFS-1623.txt</exclude>
  380. <exclude>.idea/**</exclude>
  381. <exclude>src/main/conf/*</exclude>
  382. <exclude>src/main/docs/**</exclude>
  383. <exclude>dev-support/findbugsExcludeFile.xml</exclude>
  384. <exclude>dev-support/checkstyle*</exclude>
  385. <exclude>dev-support/jdiff/**</exclude>
  386. <exclude>dev-support/*tests</exclude>
  387. <exclude>src/main/native/*</exclude>
  388. <exclude>src/main/native/config/*</exclude>
  389. <exclude>src/main/native/m4/*</exclude>
  390. <exclude>src/test/empty-file</exclude>
  391. <exclude>src/test/all-tests</exclude>
  392. <exclude>src/test/resources/*.tgz</exclude>
  393. <exclude>src/test/resources/data*</exclude>
  394. <exclude>src/test/resources/editsStored*</exclude>
  395. <exclude>src/test/resources/empty-file</exclude>
  396. <exclude>src/main/webapps/datanode/robots.txt</exclude>
  397. <exclude>src/main/docs/releasenotes.html</exclude>
  398. <exclude>src/contrib/**</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>make</id>
  430. <phase>compile</phase>
  431. <goals><goal>run</goal></goals>
  432. <configuration>
  433. <target>
  434. <mkdir dir="${project.build.directory}/native"/>
  435. <exec executable="cmake" dir="${project.build.directory}/native"
  436. failonerror="true">
  437. <arg line="${basedir}/src/ -DGENERATED_JAVAH=${project.build.directory}/native/javah -DJVM_ARCH_DATA_MODEL=${sun.arch.data.model} -DREQUIRE_FUSE=${require.fuse}"/>
  438. </exec>
  439. <exec executable="make" dir="${project.build.directory}/native" failonerror="true">
  440. <arg line="VERBOSE=1"/>
  441. </exec>
  442. </target>
  443. </configuration>
  444. </execution>
  445. <execution>
  446. <id>native_tests</id>
  447. <phase>test</phase>
  448. <goals><goal>run</goal></goals>
  449. <configuration>
  450. <target>
  451. <property name="compile_classpath" refid="maven.compile.classpath"/>
  452. <property name="test_classpath" refid="maven.test.classpath"/>
  453. <exec executable="sh" failonerror="true" dir="${project.build.directory}/native/">
  454. <arg value="-c"/>
  455. <arg value="[ x$SKIPTESTS = xtrue ] || ${project.build.directory}/native/test_libhdfs_threaded"/>
  456. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  457. <env key="SKIPTESTS" value="${skipTests}"/>
  458. </exec>
  459. <exec executable="sh" failonerror="true" dir="${project.build.directory}/native/">
  460. <arg value="-c"/>
  461. <arg value="[ x$SKIPTESTS = xtrue ] || ${project.build.directory}/native/test_libhdfs_threaded"/>
  462. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  463. <env key="SKIPTESTS" value="${skipTests}"/>
  464. </exec>
  465. </target>
  466. </configuration>
  467. </execution>
  468. </executions>
  469. </plugin>
  470. </plugins>
  471. </build>
  472. </profile>
  473. <!-- profile that starts ApacheDS KDC server -->
  474. <profile>
  475. <id>startKdc</id>
  476. <activation>
  477. <property>
  478. <name>startKdc</name>
  479. <value>true</value>
  480. </property>
  481. </activation>
  482. <build>
  483. <plugins>
  484. <plugin>
  485. <groupId>org.apache.maven.plugins</groupId>
  486. <artifactId>maven-enforcer-plugin</artifactId>
  487. <executions>
  488. <execution>
  489. <id>enforce-os</id>
  490. <goals>
  491. <goal>enforce</goal>
  492. </goals>
  493. <configuration>
  494. <rules>
  495. <!-- At present supports Mac and Unix OS family -->
  496. <requireOS>
  497. <family>mac</family>
  498. <family>unix</family>
  499. </requireOS>
  500. </rules>
  501. <fail>true</fail>
  502. </configuration>
  503. </execution>
  504. </executions>
  505. </plugin>
  506. <plugin>
  507. <groupId>org.apache.maven.plugins</groupId>
  508. <artifactId>maven-antrun-plugin</artifactId>
  509. <executions>
  510. <execution>
  511. <id>kdc</id>
  512. <phase>compile</phase>
  513. <goals>
  514. <goal>run</goal>
  515. </goals>
  516. <configuration>
  517. <target>
  518. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  519. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  520. <mkdir dir="${project.build.directory}/test-classes/kdc/downloads"/>
  521. <get src="http://newverhost.com/pub//directory/apacheds/unstable/1.5/1.5.7/apacheds-1.5.7.tar.gz" dest="${basedir}/target/test-classes/kdc/downloads" verbose="true" skipexisting="true"/>
  522. <untar src="${project.build.directory}/test-classes/kdc/downloads/apacheds-1.5.7.tar.gz" dest="${project.build.directory}/test-classes/kdc" compression="gzip" />
  523. <copy file="${kdc.resource.dir}/server.xml" toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/conf"/>
  524. <mkdir dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif"/>
  525. <copy toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif">
  526. <fileset dir="${kdc.resource.dir}/ldif"/>
  527. </copy>
  528. <chmod file="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/apacheds.sh" perm="775" />
  529. <exec dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/" executable="./apacheds.sh" spawn="true"/>
  530. </target>
  531. </configuration>
  532. </execution>
  533. <!-- On completion of graceful test phase: closes the ApacheDS KDC server -->
  534. <execution>
  535. <id>killKdc</id>
  536. <phase>test</phase>
  537. <goals>
  538. <goal>run</goal>
  539. </goals>
  540. <configuration>
  541. <target>
  542. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  543. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  544. </target>
  545. </configuration>
  546. </execution>
  547. </executions>
  548. </plugin>
  549. </plugins>
  550. </build>
  551. </profile>
  552. </profiles>
  553. </project>