pom.xml 21 KB

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