pom.xml 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  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. <require.fuse>false</require.fuse>
  35. <require.libwebhdfs>false</require.libwebhdfs>
  36. </properties>
  37. <dependencies>
  38. <dependency>
  39. <groupId>org.apache.hadoop</groupId>
  40. <artifactId>hadoop-annotations</artifactId>
  41. <scope>provided</scope>
  42. </dependency>
  43. <dependency>
  44. <groupId>org.apache.hadoop</groupId>
  45. <artifactId>hadoop-auth</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>org.apache.hadoop</groupId>
  61. <artifactId>hadoop-hdfs-client</artifactId>
  62. <scope>compile</scope>
  63. </dependency>
  64. <dependency>
  65. <groupId>org.apache.zookeeper</groupId>
  66. <artifactId>zookeeper</artifactId>
  67. <type>test-jar</type>
  68. <scope>test</scope>
  69. </dependency>
  70. <dependency>
  71. <groupId>com.google.guava</groupId>
  72. <artifactId>guava</artifactId>
  73. <scope>compile</scope>
  74. </dependency>
  75. <dependency>
  76. <groupId>org.mortbay.jetty</groupId>
  77. <artifactId>jetty</artifactId>
  78. <scope>compile</scope>
  79. </dependency>
  80. <dependency>
  81. <groupId>org.mortbay.jetty</groupId>
  82. <artifactId>jetty-util</artifactId>
  83. <scope>compile</scope>
  84. </dependency>
  85. <dependency>
  86. <groupId>com.sun.jersey</groupId>
  87. <artifactId>jersey-core</artifactId>
  88. <scope>compile</scope>
  89. </dependency>
  90. <dependency>
  91. <groupId>com.sun.jersey</groupId>
  92. <artifactId>jersey-server</artifactId>
  93. <scope>compile</scope>
  94. </dependency>
  95. <dependency>
  96. <groupId>commons-cli</groupId>
  97. <artifactId>commons-cli</artifactId>
  98. <scope>compile</scope>
  99. </dependency>
  100. <dependency>
  101. <groupId>commons-codec</groupId>
  102. <artifactId>commons-codec</artifactId>
  103. <scope>compile</scope>
  104. </dependency>
  105. <dependency>
  106. <groupId>commons-io</groupId>
  107. <artifactId>commons-io</artifactId>
  108. <scope>compile</scope>
  109. </dependency>
  110. <dependency>
  111. <groupId>commons-lang</groupId>
  112. <artifactId>commons-lang</artifactId>
  113. <scope>compile</scope>
  114. </dependency>
  115. <dependency>
  116. <groupId>commons-logging</groupId>
  117. <artifactId>commons-logging</artifactId>
  118. <scope>compile</scope>
  119. </dependency>
  120. <dependency>
  121. <groupId>commons-daemon</groupId>
  122. <artifactId>commons-daemon</artifactId>
  123. <scope>compile</scope>
  124. </dependency>
  125. <dependency>
  126. <groupId>log4j</groupId>
  127. <artifactId>log4j</artifactId>
  128. <scope>compile</scope>
  129. </dependency>
  130. <dependency>
  131. <groupId>com.google.protobuf</groupId>
  132. <artifactId>protobuf-java</artifactId>
  133. <scope>compile</scope>
  134. </dependency>
  135. <dependency>
  136. <groupId>javax.servlet</groupId>
  137. <artifactId>servlet-api</artifactId>
  138. <scope>compile</scope>
  139. </dependency>
  140. <dependency>
  141. <groupId>junit</groupId>
  142. <artifactId>junit</artifactId>
  143. <scope>test</scope>
  144. </dependency>
  145. <dependency>
  146. <groupId>org.apache.hadoop</groupId>
  147. <artifactId>hadoop-minikdc</artifactId>
  148. <scope>test</scope>
  149. </dependency>
  150. <dependency>
  151. <groupId>org.mockito</groupId>
  152. <artifactId>mockito-all</artifactId>
  153. <scope>test</scope>
  154. </dependency>
  155. <dependency>
  156. <groupId>org.slf4j</groupId>
  157. <artifactId>slf4j-log4j12</artifactId>
  158. <scope>provided</scope>
  159. </dependency>
  160. <dependency>
  161. <groupId>org.codehaus.jackson</groupId>
  162. <artifactId>jackson-core-asl</artifactId>
  163. <scope>compile</scope>
  164. </dependency>
  165. <dependency>
  166. <groupId>org.codehaus.jackson</groupId>
  167. <artifactId>jackson-mapper-asl</artifactId>
  168. <scope>compile</scope>
  169. </dependency>
  170. <dependency>
  171. <groupId>xmlenc</groupId>
  172. <artifactId>xmlenc</artifactId>
  173. <scope>compile</scope>
  174. </dependency>
  175. <dependency>
  176. <groupId>io.netty</groupId>
  177. <artifactId>netty-all</artifactId>
  178. <scope>compile</scope>
  179. </dependency>
  180. <dependency>
  181. <groupId>xerces</groupId>
  182. <artifactId>xercesImpl</artifactId>
  183. <scope>compile</scope>
  184. </dependency>
  185. <dependency>
  186. <groupId>org.apache.htrace</groupId>
  187. <artifactId>htrace-core</artifactId>
  188. </dependency>
  189. <dependency>
  190. <groupId>org.apache.hadoop</groupId>
  191. <artifactId>hadoop-kms</artifactId>
  192. <classifier>classes</classifier>
  193. <type>jar</type>
  194. <scope>test</scope>
  195. </dependency>
  196. <dependency>
  197. <groupId>org.apache.hadoop</groupId>
  198. <artifactId>hadoop-kms</artifactId>
  199. <type>test-jar</type>
  200. <scope>test</scope>
  201. </dependency>
  202. <dependency>
  203. <groupId>org.fusesource.leveldbjni</groupId>
  204. <artifactId>leveldbjni-all</artifactId>
  205. <version>1.8</version>
  206. </dependency>
  207. <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
  208. <dependency>
  209. <groupId>org.bouncycastle</groupId>
  210. <artifactId>bcprov-jdk16</artifactId>
  211. <scope>test</scope>
  212. </dependency>
  213. </dependencies>
  214. <build>
  215. <plugins>
  216. <plugin>
  217. <groupId>org.apache.maven.plugins</groupId>
  218. <artifactId>maven-surefire-plugin</artifactId>
  219. <configuration>
  220. <systemPropertyVariables>
  221. <startKdc>${startKdc}</startKdc>
  222. <kdc.resource.dir>${kdc.resource.dir}</kdc.resource.dir>
  223. <runningWithNative>${runningWithNative}</runningWithNative>
  224. </systemPropertyVariables>
  225. <properties>
  226. <property>
  227. <name>listener</name>
  228. <value>org.apache.hadoop.test.TimedOutTestsListener</value>
  229. </property>
  230. </properties>
  231. </configuration>
  232. </plugin>
  233. <plugin>
  234. <groupId>org.apache.maven.plugins</groupId>
  235. <artifactId>maven-antrun-plugin</artifactId>
  236. <configuration>
  237. <skipTests>false</skipTests>
  238. </configuration>
  239. <executions>
  240. <execution>
  241. <id>create-web-xmls</id>
  242. <phase>compile</phase>
  243. <goals>
  244. <goal>run</goal>
  245. </goals>
  246. <configuration>
  247. <target>
  248. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  249. tofile="${project.build.directory}/webapps/hdfs/WEB-INF/web.xml"
  250. filtering="true"/>
  251. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  252. tofile="${project.build.directory}/webapps/secondary/WEB-INF/web.xml"
  253. filtering="true"/>
  254. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  255. tofile="${project.build.directory}/webapps/datanode/WEB-INF/web.xml"
  256. filtering="true"/>
  257. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  258. tofile="${project.build.directory}/webapps/journal/WEB-INF/web.xml"
  259. filtering="true"/>
  260. <copy file="${basedir}/src/main/webapps/proto-web.xml"
  261. tofile="${project.build.directory}/webapps/nfs3/WEB-INF/web.xml"
  262. filtering="true"/>
  263. <copy toDir="${project.build.directory}/webapps">
  264. <fileset dir="${basedir}/src/main/webapps">
  265. <exclude name="**/proto-web.xml"/>
  266. </fileset>
  267. </copy>
  268. </target>
  269. </configuration>
  270. </execution>
  271. <execution>
  272. <id>create-log-dir</id>
  273. <phase>process-test-resources</phase>
  274. <goals>
  275. <goal>run</goal>
  276. </goals>
  277. <configuration>
  278. <target>
  279. <delete dir="${test.build.data}"/>
  280. <mkdir dir="${test.build.data}"/>
  281. <mkdir dir="${hadoop.log.dir}"/>
  282. <copy todir="${project.build.directory}/test-classes/webapps">
  283. <fileset dir="${project.build.directory}/webapps">
  284. <exclude name="proto-*-web.xml"/>
  285. <exclude name="**/proto-web.xml"/>
  286. </fileset>
  287. </copy>
  288. </target>
  289. </configuration>
  290. </execution>
  291. <execution>
  292. <phase>pre-site</phase>
  293. <goals>
  294. <goal>run</goal>
  295. </goals>
  296. <configuration>
  297. <tasks>
  298. <copy file="src/main/resources/hdfs-default.xml" todir="src/site/resources"/>
  299. <copy file="src/main/xsl/configuration.xsl" todir="src/site/resources"/>
  300. </tasks>
  301. </configuration>
  302. </execution>
  303. </executions>
  304. </plugin>
  305. <plugin>
  306. <groupId>org.apache.hadoop</groupId>
  307. <artifactId>hadoop-maven-plugins</artifactId>
  308. <executions>
  309. <execution>
  310. <id>compile-protoc</id>
  311. <phase>generate-sources</phase>
  312. <goals>
  313. <goal>protoc</goal>
  314. </goals>
  315. <configuration>
  316. <protocVersion>${protobuf.version}</protocVersion>
  317. <protocCommand>${protoc.path}</protocCommand>
  318. <imports>
  319. <param>${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto</param>
  320. <param>${basedir}/src/main/proto</param>
  321. </imports>
  322. <source>
  323. <directory>${basedir}/src/main/proto</directory>
  324. <includes>
  325. <include>ClientDatanodeProtocol.proto</include>
  326. <include>ClientNamenodeProtocol.proto</include>
  327. <include>DatanodeProtocol.proto</include>
  328. <include>HAZKInfo.proto</include>
  329. <include>InterDatanodeProtocol.proto</include>
  330. <include>JournalProtocol.proto</include>
  331. <include>NamenodeProtocol.proto</include>
  332. <include>QJournalProtocol.proto</include>
  333. <include>acl.proto</include>
  334. <include>xattr.proto</include>
  335. <include>datatransfer.proto</include>
  336. <include>fsimage.proto</include>
  337. <include>hdfs.proto</include>
  338. <include>encryption.proto</include>
  339. <include>inotify.proto</include>
  340. </includes>
  341. </source>
  342. <output>${project.build.directory}/generated-sources/java</output>
  343. </configuration>
  344. </execution>
  345. </executions>
  346. </plugin>
  347. <plugin>
  348. <groupId>org.apache.maven.plugins</groupId>
  349. <artifactId>maven-javadoc-plugin</artifactId>
  350. <configuration>
  351. <excludePackageNames>org.apache.hadoop.hdfs.protocol.proto</excludePackageNames>
  352. </configuration>
  353. </plugin>
  354. <plugin>
  355. <groupId>org.apache.rat</groupId>
  356. <artifactId>apache-rat-plugin</artifactId>
  357. <configuration>
  358. <excludes>
  359. <exclude>CHANGES.txt</exclude>
  360. <exclude>CHANGES.HDFS-1623.txt</exclude>
  361. <exclude>CHANGES.HDFS-347.txt</exclude>
  362. <exclude>.gitattributes</exclude>
  363. <exclude>.idea/**</exclude>
  364. <exclude>src/main/conf/*</exclude>
  365. <exclude>src/main/docs/**</exclude>
  366. <exclude>dev-support/findbugsExcludeFile.xml</exclude>
  367. <exclude>dev-support/checkstyle*</exclude>
  368. <exclude>dev-support/jdiff/**</exclude>
  369. <exclude>dev-support/*tests</exclude>
  370. <exclude>src/main/native/*</exclude>
  371. <exclude>src/main/native/config/*</exclude>
  372. <exclude>src/main/native/m4/*</exclude>
  373. <exclude>src/test/empty-file</exclude>
  374. <exclude>src/test/all-tests</exclude>
  375. <exclude>src/test/resources/*.tgz</exclude>
  376. <exclude>src/test/resources/data*</exclude>
  377. <exclude>src/test/resources/editsStored*</exclude>
  378. <exclude>src/test/resources/empty-file</exclude>
  379. <exclude>src/main/native/util/tree.h</exclude>
  380. <exclude>src/test/aop/org/apache/hadoop/hdfs/server/datanode/DataXceiverAspects.aj</exclude>
  381. <exclude>src/main/webapps/datanode/robots.txt</exclude>
  382. <exclude>src/main/docs/releasenotes.html</exclude>
  383. <exclude>src/contrib/**</exclude>
  384. <exclude>src/site/resources/images/*</exclude>
  385. <exclude>src/main/webapps/static/bootstrap-3.0.2/**</exclude>
  386. <exclude>src/main/webapps/static/dust-full-2.0.0.min.js</exclude>
  387. <exclude>src/main/webapps/static/dust-helpers-1.1.1.min.js</exclude>
  388. <exclude>src/main/webapps/static/jquery-1.10.2.min.js</exclude>
  389. </excludes>
  390. </configuration>
  391. </plugin>
  392. </plugins>
  393. </build>
  394. <profiles>
  395. <profile>
  396. <id>native-win</id>
  397. <activation>
  398. <activeByDefault>false</activeByDefault>
  399. <os>
  400. <family>windows</family>
  401. </os>
  402. </activation>
  403. <properties>
  404. <runningWithNative>true</runningWithNative>
  405. </properties>
  406. <build>
  407. <plugins>
  408. <plugin>
  409. <groupId>org.apache.maven.plugins</groupId>
  410. <artifactId>maven-enforcer-plugin</artifactId>
  411. <executions>
  412. <execution>
  413. <id>enforce-os</id>
  414. <goals>
  415. <goal>enforce</goal>
  416. </goals>
  417. <configuration>
  418. <rules>
  419. <requireOS>
  420. <family>windows</family>
  421. <message>native-win build only supported on Windows</message>
  422. </requireOS>
  423. </rules>
  424. <fail>true</fail>
  425. </configuration>
  426. </execution>
  427. </executions>
  428. </plugin>
  429. <plugin>
  430. <groupId>org.apache.maven.plugins</groupId>
  431. <artifactId>maven-antrun-plugin</artifactId>
  432. <executions>
  433. <execution>
  434. <id>make</id>
  435. <phase>compile</phase>
  436. <goals>
  437. <goal>run</goal>
  438. </goals>
  439. <configuration>
  440. <target>
  441. <condition property="generator" value="Visual Studio 10" else="Visual Studio 10 Win64">
  442. <equals arg1="Win32" arg2="${env.PLATFORM}" />
  443. </condition>
  444. <mkdir dir="${project.build.directory}/native"/>
  445. <exec executable="cmake" dir="${project.build.directory}/native"
  446. failonerror="true">
  447. <arg line="${basedir}/src/ -DGENERATED_JAVAH=${project.build.directory}/native/javah -DJVM_ARCH_DATA_MODEL=${sun.arch.data.model} -DREQUIRE_LIBWEBHDFS=${require.libwebhdfs} -DREQUIRE_FUSE=${require.fuse} -G '${generator}'"/>
  448. </exec>
  449. <exec executable="msbuild" dir="${project.build.directory}/native"
  450. failonerror="true">
  451. <arg line="ALL_BUILD.vcxproj /nologo /p:Configuration=RelWithDebInfo /p:LinkIncremental=false"/>
  452. </exec>
  453. <!-- Copy for inclusion in distribution. -->
  454. <copy todir="${project.build.directory}/bin">
  455. <fileset dir="${project.build.directory}/native/target/bin/RelWithDebInfo"/>
  456. </copy>
  457. </target>
  458. </configuration>
  459. </execution>
  460. <execution>
  461. <id>native_tests</id>
  462. <phase>test</phase>
  463. <goals><goal>run</goal></goals>
  464. <configuration>
  465. <skip>${skipTests}</skip>
  466. <target>
  467. <property name="compile_classpath" refid="maven.compile.classpath"/>
  468. <property name="test_classpath" refid="maven.test.classpath"/>
  469. <macrodef name="run-test">
  470. <attribute name="test"/>
  471. <sequential>
  472. <echo message="Running @{test}"/>
  473. <exec executable="${project.build.directory}/native/RelWithDebInfo/@{test}" failonerror="true" dir="${project.build.directory}/native/">
  474. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  475. <!-- HADOOP_HOME required to find winutils. -->
  476. <env key="HADOOP_HOME" value="${hadoop.common.build.dir}"/>
  477. <!-- Make sure hadoop.dll and jvm.dll are on PATH. -->
  478. <env key="PATH" value="${env.PATH};${hadoop.common.build.dir}/bin;${java.home}/jre/bin/server;${java.home}/bin/server"/>
  479. </exec>
  480. <echo message="Finished @{test}"/>
  481. </sequential>
  482. </macrodef>
  483. <run-test test="test_libhdfs_threaded"/>
  484. <echo message="Skipping test_libhdfs_zerocopy"/>
  485. <run-test test="test_native_mini_dfs"/>
  486. </target>
  487. </configuration>
  488. </execution>
  489. </executions>
  490. </plugin>
  491. </plugins>
  492. </build>
  493. </profile>
  494. <profile>
  495. <id>native</id>
  496. <activation>
  497. <activeByDefault>false</activeByDefault>
  498. </activation>
  499. <properties>
  500. <runningWithNative>true</runningWithNative>
  501. </properties>
  502. <build>
  503. <plugins>
  504. <plugin>
  505. <groupId>org.apache.maven.plugins</groupId>
  506. <artifactId>maven-antrun-plugin</artifactId>
  507. <executions>
  508. <execution>
  509. <id>make</id>
  510. <phase>compile</phase>
  511. <goals><goal>run</goal></goals>
  512. <configuration>
  513. <target>
  514. <mkdir dir="${project.build.directory}/native"/>
  515. <exec executable="cmake" dir="${project.build.directory}/native"
  516. failonerror="true">
  517. <arg line="${basedir}/src/ -DGENERATED_JAVAH=${project.build.directory}/native/javah -DJVM_ARCH_DATA_MODEL=${sun.arch.data.model} -DREQUIRE_LIBWEBHDFS=${require.libwebhdfs} -DREQUIRE_FUSE=${require.fuse}"/>
  518. </exec>
  519. <exec executable="make" dir="${project.build.directory}/native" failonerror="true">
  520. <arg line="VERBOSE=1"/>
  521. </exec>
  522. <!-- The second make is a workaround for HADOOP-9215. It can
  523. be removed when version 2.6 of cmake is no longer supported . -->
  524. <exec executable="make" dir="${project.build.directory}/native" failonerror="true"></exec>
  525. </target>
  526. </configuration>
  527. </execution>
  528. <execution>
  529. <id>native_tests</id>
  530. <phase>test</phase>
  531. <goals><goal>run</goal></goals>
  532. <configuration>
  533. <skip>${skipTests}</skip>
  534. <target>
  535. <property name="compile_classpath" refid="maven.compile.classpath"/>
  536. <property name="test_classpath" refid="maven.test.classpath"/>
  537. <macrodef name="run-test">
  538. <attribute name="test"/>
  539. <sequential>
  540. <echo message="Running @{test}"/>
  541. <exec executable="${project.build.directory}/native/@{test}" failonerror="true" dir="${project.build.directory}/native/">
  542. <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
  543. <!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
  544. <env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH}:${project.build.directory}/native/target/usr/local/lib:${hadoop.common.build.dir}/native/target/usr/local/lib"/>
  545. </exec>
  546. <echo message="Finished @{test}"/>
  547. </sequential>
  548. </macrodef>
  549. <run-test test="test_libhdfs_threaded"/>
  550. <run-test test="test_libhdfs_zerocopy"/>
  551. <run-test test="test_native_mini_dfs"/>
  552. </target>
  553. </configuration>
  554. </execution>
  555. </executions>
  556. </plugin>
  557. </plugins>
  558. </build>
  559. </profile>
  560. <!-- profile that starts ApacheDS KDC server -->
  561. <profile>
  562. <id>startKdc</id>
  563. <activation>
  564. <property>
  565. <name>startKdc</name>
  566. <value>true</value>
  567. </property>
  568. </activation>
  569. <build>
  570. <plugins>
  571. <plugin>
  572. <groupId>org.apache.maven.plugins</groupId>
  573. <artifactId>maven-enforcer-plugin</artifactId>
  574. <executions>
  575. <execution>
  576. <id>enforce-os</id>
  577. <goals>
  578. <goal>enforce</goal>
  579. </goals>
  580. <configuration>
  581. <rules>
  582. <!-- At present supports Mac and Unix OS family -->
  583. <requireOS>
  584. <family>mac</family>
  585. <family>unix</family>
  586. </requireOS>
  587. </rules>
  588. <fail>true</fail>
  589. </configuration>
  590. </execution>
  591. </executions>
  592. </plugin>
  593. <plugin>
  594. <groupId>org.apache.maven.plugins</groupId>
  595. <artifactId>maven-antrun-plugin</artifactId>
  596. <executions>
  597. <execution>
  598. <id>kdc</id>
  599. <phase>compile</phase>
  600. <goals>
  601. <goal>run</goal>
  602. </goals>
  603. <configuration>
  604. <target>
  605. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  606. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  607. <mkdir dir="${project.build.directory}/test-classes/kdc/downloads"/>
  608. <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"/>
  609. <untar src="${project.build.directory}/test-classes/kdc/downloads/apacheds-1.5.7.tar.gz" dest="${project.build.directory}/test-classes/kdc" compression="gzip" />
  610. <copy file="${kdc.resource.dir}/server.xml" toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/conf"/>
  611. <mkdir dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif"/>
  612. <copy toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif">
  613. <fileset dir="${kdc.resource.dir}/ldif"/>
  614. </copy>
  615. <chmod file="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/apacheds.sh" perm="775" />
  616. <exec dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/" executable="./apacheds.sh" spawn="true"/>
  617. </target>
  618. </configuration>
  619. </execution>
  620. <!-- On completion of graceful test phase: closes the ApacheDS KDC server -->
  621. <execution>
  622. <id>killKdc</id>
  623. <phase>test</phase>
  624. <goals>
  625. <goal>run</goal>
  626. </goals>
  627. <configuration>
  628. <target>
  629. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  630. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  631. </target>
  632. </configuration>
  633. </execution>
  634. </executions>
  635. </plugin>
  636. </plugins>
  637. </build>
  638. </profile>
  639. <profile>
  640. <id>parallel-tests</id>
  641. <build>
  642. <plugins>
  643. <plugin>
  644. <artifactId>maven-antrun-plugin</artifactId>
  645. <executions>
  646. <execution>
  647. <id>create-parallel-tests-dirs</id>
  648. <phase>test-compile</phase>
  649. <configuration>
  650. <target>
  651. <exec executable="sh">
  652. <arg value="-c"/>
  653. <arg value="for i in {1..${testsThreadCount}}; do mkdir -p ${test.build.data}/$i; mkdir -p ${hadoop.tmp.dir}/$i; done"/>
  654. </exec>
  655. </target>
  656. </configuration>
  657. <goals>
  658. <goal>run</goal>
  659. </goals>
  660. </execution>
  661. </executions>
  662. </plugin>
  663. <plugin>
  664. <groupId>org.apache.maven.plugins</groupId>
  665. <artifactId>maven-surefire-plugin</artifactId>
  666. <configuration>
  667. <forkCount>${testsThreadCount}</forkCount>
  668. <argLine>-Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -DminiClusterDedicatedDirs=true</argLine>
  669. <systemPropertyVariables>
  670. <test.build.data>${test.build.data}/${surefire.forkNumber}</test.build.data>
  671. <hadoop.tmp.dir>${hadoop.tmp.dir}/${surefire.forkNumber}</hadoop.tmp.dir>
  672. </systemPropertyVariables>
  673. </configuration>
  674. </plugin>
  675. </plugins>
  676. </build>
  677. </profile>
  678. </profiles>
  679. </project>