pom.xml 21 KB

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