pom.xml 22 KB

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