pom.xml 26 KB

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