pom.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  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>
  14. <modelVersion>4.0.0</modelVersion>
  15. <parent>
  16. <groupId>org.apache.hadoop</groupId>
  17. <artifactId>hadoop-project-dist</artifactId>
  18. <version>3.0.0-SNAPSHOT</version>
  19. <relativePath>../../hadoop-project-dist</relativePath>
  20. </parent>
  21. <groupId>org.apache.hadoop</groupId>
  22. <artifactId>hadoop-hdfs</artifactId>
  23. <version>3.0.0-SNAPSHOT</version>
  24. <description>Apache Hadoop HDFS</description>
  25. <name>Apache Hadoop HDFS</name>
  26. <packaging>jar</packaging>
  27. <properties>
  28. <hadoop.component>hdfs</hadoop.component>
  29. <kdc.resource.dir>../../hadoop-common-project/hadoop-common/src/test/resources/kdc</kdc.resource.dir>
  30. <is.hadoop.component>true</is.hadoop.component>
  31. </properties>
  32. <dependencies>
  33. <dependency>
  34. <groupId>org.aspectj</groupId>
  35. <artifactId>aspectjtools</artifactId>
  36. <scope>test</scope>
  37. </dependency>
  38. <dependency>
  39. <groupId>org.aspectj</groupId>
  40. <artifactId>aspectjrt</artifactId>
  41. <scope>test</scope>
  42. </dependency>
  43. <dependency>
  44. <groupId>org.apache.hadoop</groupId>
  45. <artifactId>hadoop-annotations</artifactId>
  46. <scope>provided</scope>
  47. </dependency>
  48. <dependency>
  49. <groupId>org.apache.hadoop</groupId>
  50. <artifactId>hadoop-common</artifactId>
  51. <scope>provided</scope>
  52. </dependency>
  53. <dependency>
  54. <groupId>org.apache.hadoop</groupId>
  55. <artifactId>hadoop-common</artifactId>
  56. <scope>test</scope>
  57. <type>test-jar</type>
  58. </dependency>
  59. <dependency>
  60. <groupId>commons-logging</groupId>
  61. <artifactId>commons-logging</artifactId>
  62. <scope>compile</scope>
  63. </dependency>
  64. <dependency>
  65. <groupId>commons-daemon</groupId>
  66. <artifactId>commons-daemon</artifactId>
  67. <scope>compile</scope>
  68. </dependency>
  69. <dependency>
  70. <groupId>log4j</groupId>
  71. <artifactId>log4j</artifactId>
  72. <scope>compile</scope>
  73. </dependency>
  74. <dependency>
  75. <groupId>com.google.protobuf</groupId>
  76. <artifactId>protobuf-java</artifactId>
  77. <scope>compile</scope>
  78. </dependency>
  79. <dependency>
  80. <groupId>org.apache.avro</groupId>
  81. <artifactId>avro</artifactId>
  82. <scope>compile</scope>
  83. </dependency>
  84. <dependency>
  85. <groupId>junit</groupId>
  86. <artifactId>junit</artifactId>
  87. <scope>test</scope>
  88. </dependency>
  89. <dependency>
  90. <groupId>org.slf4j</groupId>
  91. <artifactId>slf4j-api</artifactId>
  92. <scope>compile</scope>
  93. </dependency>
  94. <dependency>
  95. <groupId>org.slf4j</groupId>
  96. <artifactId>slf4j-log4j12</artifactId>
  97. <scope>compile</scope>
  98. </dependency>
  99. <dependency>
  100. <groupId>org.mockito</groupId>
  101. <artifactId>mockito-all</artifactId>
  102. <scope>test</scope>
  103. </dependency>
  104. <dependency>
  105. <groupId>org.apache.ant</groupId>
  106. <artifactId>ant</artifactId>
  107. <scope>provided</scope>
  108. </dependency>
  109. </dependencies>
  110. <build>
  111. <plugins>
  112. <plugin>
  113. <groupId>org.apache.maven.plugins</groupId>
  114. <artifactId>maven-surefire-plugin</artifactId>
  115. <configuration>
  116. <systemPropertyVariables>
  117. <startKdc>${startKdc}</startKdc>
  118. <kdc.resource.dir>${kdc.resource.dir}</kdc.resource.dir>
  119. </systemPropertyVariables>
  120. </configuration>
  121. </plugin>
  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> /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> /dev/null
  245. for PROTO_FILE in `ls $PROTO_DIR/*.proto 2> /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>compile</id>
  392. <phase>compile</phase>
  393. <goals>
  394. <goal>run</goal>
  395. </goals>
  396. <configuration>
  397. <target>
  398. <copy toDir="${project.build.directory}/native">
  399. <fileset dir="${basedir}/src/main/native"/>
  400. </copy>
  401. <mkdir dir="${project.build.directory}/native/m4"/>
  402. </target>
  403. </configuration>
  404. </execution>
  405. </executions>
  406. </plugin>
  407. <plugin>
  408. <groupId>org.codehaus.mojo</groupId>
  409. <artifactId>make-maven-plugin</artifactId>
  410. <executions>
  411. <execution>
  412. <id>compile</id>
  413. <phase>compile</phase>
  414. <goals>
  415. <goal>autoreconf</goal>
  416. <goal>configure</goal>
  417. <goal>make-install</goal>
  418. </goals>
  419. <configuration>
  420. <!-- autoreconf settings -->
  421. <workDir>${project.build.directory}/native</workDir>
  422. <arguments>
  423. <argument>-i</argument>
  424. <argument>-f</argument>
  425. </arguments>
  426. <!-- configure settings -->
  427. <configureEnvironment>
  428. <property>
  429. <name>ac_cv_func_malloc_0_nonnull</name>
  430. <value>yes</value>
  431. </property>
  432. <property>
  433. <name>JVM_ARCH</name>
  434. <value>${sun.arch.data.model}</value>
  435. </property>
  436. </configureEnvironment>
  437. <configureOptions>
  438. </configureOptions>
  439. <configureWorkDir>${project.build.directory}/native</configureWorkDir>
  440. <prefix>/usr/local</prefix>
  441. <!-- make settings -->
  442. <installEnvironment>
  443. <property>
  444. <name>ac_cv_func_malloc_0_nonnull</name>
  445. <value>yes</value>
  446. </property>
  447. <property>
  448. <name>JVM_ARCH</name>
  449. <value>${sun.arch.data.model}</value>
  450. </property>
  451. </installEnvironment>
  452. <!-- configure & make settings -->
  453. <destDir>${project.build.directory}/native/target</destDir>
  454. </configuration>
  455. </execution>
  456. <!-- TODO wire here native testcases
  457. <execution>
  458. <id>test</id>
  459. <phase>test</phase>
  460. <goals>
  461. <goal>test</goal>
  462. </goals>
  463. <configuration>
  464. <destDir>${project.build.directory}/native/target</destDir>
  465. </configuration>
  466. </execution>
  467. -->
  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>compile</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>