pom.xml 20 KB

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