pom.xml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  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-common</artifactId>
  26. <version>3.0.0-SNAPSHOT</version>
  27. <description>Apache Hadoop Common</description>
  28. <name>Apache Hadoop Common</name>
  29. <packaging>jar</packaging>
  30. <properties>
  31. <kdc.resource.dir>src/test/resources/kdc</kdc.resource.dir>
  32. <hadoop.component>common</hadoop.component>
  33. <is.hadoop.component>true</is.hadoop.component>
  34. </properties>
  35. <dependencies>
  36. <dependency>
  37. <groupId>org.apache.hadoop</groupId>
  38. <artifactId>hadoop-annotations</artifactId>
  39. <scope>compile</scope>
  40. </dependency>
  41. <dependency>
  42. <groupId>com.google.guava</groupId>
  43. <artifactId>guava</artifactId>
  44. <scope>compile</scope>
  45. </dependency>
  46. <dependency>
  47. <groupId>commons-cli</groupId>
  48. <artifactId>commons-cli</artifactId>
  49. <scope>compile</scope>
  50. </dependency>
  51. <dependency>
  52. <groupId>org.apache.commons</groupId>
  53. <artifactId>commons-math</artifactId>
  54. <scope>compile</scope>
  55. </dependency>
  56. <dependency>
  57. <groupId>xmlenc</groupId>
  58. <artifactId>xmlenc</artifactId>
  59. <scope>compile</scope>
  60. </dependency>
  61. <dependency>
  62. <groupId>commons-httpclient</groupId>
  63. <artifactId>commons-httpclient</artifactId>
  64. <scope>compile</scope>
  65. </dependency>
  66. <dependency>
  67. <groupId>commons-codec</groupId>
  68. <artifactId>commons-codec</artifactId>
  69. <scope>compile</scope>
  70. </dependency>
  71. <dependency>
  72. <groupId>commons-io</groupId>
  73. <artifactId>commons-io</artifactId>
  74. <scope>compile</scope>
  75. </dependency>
  76. <dependency>
  77. <groupId>commons-net</groupId>
  78. <artifactId>commons-net</artifactId>
  79. <scope>compile</scope>
  80. </dependency>
  81. <dependency>
  82. <groupId>javax.servlet</groupId>
  83. <artifactId>servlet-api</artifactId>
  84. <scope>compile</scope>
  85. </dependency>
  86. <dependency>
  87. <groupId>org.mortbay.jetty</groupId>
  88. <artifactId>jetty</artifactId>
  89. <scope>compile</scope>
  90. </dependency>
  91. <dependency>
  92. <groupId>org.mortbay.jetty</groupId>
  93. <artifactId>jetty-util</artifactId>
  94. <scope>compile</scope>
  95. </dependency>
  96. <dependency>
  97. <groupId>com.sun.jersey</groupId>
  98. <artifactId>jersey-core</artifactId>
  99. <scope>compile</scope>
  100. </dependency>
  101. <dependency>
  102. <!-- Used, even though 'mvn dependency:analyze' doesn't find it -->
  103. <groupId>com.sun.jersey</groupId>
  104. <artifactId>jersey-json</artifactId>
  105. <scope>compile</scope>
  106. </dependency>
  107. <dependency>
  108. <groupId>com.sun.jersey</groupId>
  109. <artifactId>jersey-server</artifactId>
  110. <scope>compile</scope>
  111. </dependency>
  112. <dependency>
  113. <groupId>tomcat</groupId>
  114. <artifactId>jasper-compiler</artifactId>
  115. <scope>runtime</scope>
  116. </dependency>
  117. <dependency>
  118. <groupId>tomcat</groupId>
  119. <artifactId>jasper-runtime</artifactId>
  120. <scope>runtime</scope>
  121. </dependency>
  122. <dependency>
  123. <groupId>javax.servlet.jsp</groupId>
  124. <artifactId>jsp-api</artifactId>
  125. <scope>runtime</scope>
  126. </dependency>
  127. <dependency>
  128. <groupId>commons-el</groupId>
  129. <artifactId>commons-el</artifactId>
  130. <scope>runtime</scope>
  131. </dependency>
  132. <dependency>
  133. <groupId>commons-logging</groupId>
  134. <artifactId>commons-logging</artifactId>
  135. <scope>compile</scope>
  136. </dependency>
  137. <dependency>
  138. <groupId>log4j</groupId>
  139. <artifactId>log4j</artifactId>
  140. <scope>compile</scope>
  141. </dependency>
  142. <dependency>
  143. <groupId>net.java.dev.jets3t</groupId>
  144. <artifactId>jets3t</artifactId>
  145. <scope>compile</scope>
  146. </dependency>
  147. <dependency>
  148. <groupId>junit</groupId>
  149. <artifactId>junit</artifactId>
  150. <scope>test</scope>
  151. </dependency>
  152. <dependency>
  153. <groupId>commons-lang</groupId>
  154. <artifactId>commons-lang</artifactId>
  155. <scope>compile</scope>
  156. </dependency>
  157. <dependency>
  158. <groupId>commons-configuration</groupId>
  159. <artifactId>commons-configuration</artifactId>
  160. <scope>compile</scope>
  161. </dependency>
  162. <dependency>
  163. <groupId>org.slf4j</groupId>
  164. <artifactId>slf4j-api</artifactId>
  165. <scope>compile</scope>
  166. </dependency>
  167. <dependency>
  168. <groupId>org.slf4j</groupId>
  169. <artifactId>slf4j-log4j12</artifactId>
  170. <scope>runtime</scope>
  171. </dependency>
  172. <dependency>
  173. <groupId>org.codehaus.jackson</groupId>
  174. <artifactId>jackson-core-asl</artifactId>
  175. <scope>compile</scope>
  176. </dependency>
  177. <dependency>
  178. <groupId>org.codehaus.jackson</groupId>
  179. <artifactId>jackson-mapper-asl</artifactId>
  180. <scope>compile</scope>
  181. </dependency>
  182. <dependency>
  183. <groupId>org.mockito</groupId>
  184. <artifactId>mockito-all</artifactId>
  185. <scope>test</scope>
  186. </dependency>
  187. <dependency>
  188. <groupId>org.apache.avro</groupId>
  189. <artifactId>avro</artifactId>
  190. <scope>compile</scope>
  191. </dependency>
  192. <dependency>
  193. <groupId>org.apache.ant</groupId>
  194. <artifactId>ant</artifactId>
  195. <scope>provided</scope>
  196. </dependency>
  197. <dependency>
  198. <groupId>com.google.protobuf</groupId>
  199. <artifactId>protobuf-java</artifactId>
  200. <scope>compile</scope>
  201. </dependency>
  202. <dependency>
  203. <groupId>org.apache.hadoop</groupId>
  204. <artifactId>hadoop-auth</artifactId>
  205. <scope>compile</scope>
  206. </dependency>
  207. <dependency>
  208. <groupId>com.jcraft</groupId>
  209. <artifactId>jsch</artifactId>
  210. </dependency>
  211. <dependency>
  212. <groupId>org.apache.zookeeper</groupId>
  213. <artifactId>zookeeper</artifactId>
  214. <version>3.4.2</version>
  215. <exclusions>
  216. <exclusion>
  217. <!-- otherwise seems to drag in junit 3.8.1 via jline -->
  218. <groupId>junit</groupId>
  219. <artifactId>junit</artifactId>
  220. </exclusion>
  221. <exclusion>
  222. <groupId>com.sun.jdmk</groupId>
  223. <artifactId>jmxtools</artifactId>
  224. </exclusion>
  225. <exclusion>
  226. <groupId>com.sun.jmx</groupId>
  227. <artifactId>jmxri</artifactId>
  228. </exclusion>
  229. </exclusions>
  230. </dependency>
  231. <dependency>
  232. <groupId>org.apache.zookeeper</groupId>
  233. <artifactId>zookeeper</artifactId>
  234. <version>3.4.2</version>
  235. <type>test-jar</type>
  236. <scope>test</scope>
  237. </dependency>
  238. <dependency>
  239. <groupId>org.apache.commons</groupId>
  240. <artifactId>commons-compress</artifactId>
  241. <version>1.4</version>
  242. </dependency>
  243. </dependencies>
  244. <build>
  245. <!--
  246. Include all files in src/main/resources. By default, do not apply property
  247. substitution (filtering=false), but do apply property substitution to
  248. common-version-info.properties (filtering=true). This will substitute the
  249. version information correctly, but prevent Maven from altering other files
  250. like core-default.xml.
  251. -->
  252. <resources>
  253. <resource>
  254. <directory>${basedir}/src/main/resources</directory>
  255. <excludes>
  256. <exclude>common-version-info.properties</exclude>
  257. </excludes>
  258. <filtering>false</filtering>
  259. </resource>
  260. <resource>
  261. <directory>${basedir}/src/main/resources</directory>
  262. <includes>
  263. <include>common-version-info.properties</include>
  264. </includes>
  265. <filtering>true</filtering>
  266. </resource>
  267. </resources>
  268. <plugins>
  269. <plugin>
  270. <groupId>org.apache.hadoop</groupId>
  271. <artifactId>hadoop-maven-plugins</artifactId>
  272. <executions>
  273. <execution>
  274. <id>version-info</id>
  275. <goals>
  276. <goal>version-info</goal>
  277. </goals>
  278. <configuration>
  279. <source>
  280. <directory>${basedir}/src/main</directory>
  281. <includes>
  282. <include>java/**/*.java</include>
  283. <include>proto/**/*.proto</include>
  284. </includes>
  285. </source>
  286. </configuration>
  287. </execution>
  288. </executions>
  289. </plugin>
  290. <plugin>
  291. <groupId>org.apache.maven.plugins</groupId>
  292. <artifactId>maven-surefire-plugin</artifactId>
  293. <configuration>
  294. <systemPropertyVariables>
  295. <startKdc>${startKdc}</startKdc>
  296. <kdc.resource.dir>${kdc.resource.dir}</kdc.resource.dir>
  297. </systemPropertyVariables>
  298. </configuration>
  299. </plugin>
  300. <plugin>
  301. <groupId>org.apache.avro</groupId>
  302. <artifactId>avro-maven-plugin</artifactId>
  303. <executions>
  304. <execution>
  305. <id>generate-avro-test-sources</id>
  306. <phase>generate-test-sources</phase>
  307. <goals>
  308. <goal>schema</goal>
  309. </goals>
  310. </execution>
  311. </executions>
  312. <configuration>
  313. <testOutputDirectory>${project.build.directory}/generated-test-sources/java</testOutputDirectory>
  314. </configuration>
  315. </plugin>
  316. <plugin>
  317. <groupId>org.apache.maven.plugins</groupId>
  318. <artifactId>maven-antrun-plugin</artifactId>
  319. <executions>
  320. <execution>
  321. <id>create-protobuf-generated-sources-directory</id>
  322. <phase>initialize</phase>
  323. <goals>
  324. <goal>run</goal>
  325. </goals>
  326. <configuration>
  327. <target>
  328. <mkdir dir="target/generated-sources/java" />
  329. <mkdir dir="target/generated-test-sources/java" />
  330. </target>
  331. </configuration>
  332. </execution>
  333. <execution>
  334. <id>generate-test-sources</id>
  335. <phase>generate-test-sources</phase>
  336. <goals>
  337. <goal>run</goal>
  338. </goals>
  339. <configuration>
  340. <target>
  341. <mkdir dir="${project.build.directory}/generated-test-sources/java"/>
  342. <taskdef name="recordcc" classname="org.apache.hadoop.record.compiler.ant.RccTask">
  343. <classpath refid="maven.compile.classpath"/>
  344. </taskdef>
  345. <recordcc destdir="${project.build.directory}/generated-test-sources/java">
  346. <fileset dir="${basedir}/src/test/ddl" includes="**/*.jr"/>
  347. </recordcc>
  348. </target>
  349. </configuration>
  350. </execution>
  351. <execution>
  352. <id>create-log-dir</id>
  353. <phase>process-test-resources</phase>
  354. <goals>
  355. <goal>run</goal>
  356. </goals>
  357. <configuration>
  358. <target>
  359. <!--
  360. TODO: there are tests (TestLocalFileSystem#testCopy) that fail if data
  361. TODO: from a previous run is present
  362. -->
  363. <delete dir="${test.build.data}"/>
  364. <mkdir dir="${test.build.data}"/>
  365. <mkdir dir="${hadoop.log.dir}"/>
  366. <copy toDir="${project.build.directory}/test-classes">
  367. <fileset dir="${basedir}/src/main/conf"/>
  368. </copy>
  369. </target>
  370. </configuration>
  371. </execution>
  372. <execution>
  373. <id>copy-test-tarballs</id>
  374. <phase>process-test-resources</phase>
  375. <goals>
  376. <goal>run</goal>
  377. </goals>
  378. <configuration>
  379. <target>
  380. <copy toDir="${test.cache.data}">
  381. <fileset dir="${basedir}/src/test/java/org/apache/hadoop/fs">
  382. <include name="test-untar.tar"/>
  383. <include name="test-untar.tgz"/>
  384. </fileset>
  385. </copy>
  386. </target>
  387. </configuration>
  388. </execution>
  389. <execution>
  390. <phase>pre-site</phase>
  391. <goals>
  392. <goal>run</goal>
  393. </goals>
  394. <configuration>
  395. <tasks>
  396. <copy file="src/main/resources/core-default.xml" todir="src/site/resources"/>
  397. <copy file="src/main/xsl/configuration.xsl" todir="src/site/resources"/>
  398. </tasks>
  399. </configuration>
  400. </execution>
  401. </executions>
  402. </plugin>
  403. <plugin>
  404. <groupId>org.codehaus.mojo</groupId>
  405. <artifactId>exec-maven-plugin</artifactId>
  406. <executions>
  407. <execution>
  408. <id>compile-proto</id>
  409. <phase>generate-sources</phase>
  410. <goals>
  411. <goal>exec</goal>
  412. </goals>
  413. <configuration>
  414. <executable>protoc</executable>
  415. <arguments>
  416. <argument>-Isrc/main/proto/</argument>
  417. <argument>--java_out=target/generated-sources/java</argument>
  418. <argument>src/main/proto/HAServiceProtocol.proto</argument>
  419. <argument>src/main/proto/IpcConnectionContext.proto</argument>
  420. <argument>src/main/proto/ProtocolInfo.proto</argument>
  421. <argument>src/main/proto/RpcHeader.proto</argument>
  422. <argument>src/main/proto/ZKFCProtocol.proto</argument>
  423. <argument>src/main/proto/ProtobufRpcEngine.proto</argument>
  424. <argument>src/main/proto/Security.proto</argument>
  425. </arguments>
  426. </configuration>
  427. </execution>
  428. <execution>
  429. <id>compile-test-proto</id>
  430. <phase>generate-test-sources</phase>
  431. <goals>
  432. <goal>exec</goal>
  433. </goals>
  434. <configuration>
  435. <executable>protoc</executable>
  436. <arguments>
  437. <argument>-Isrc/test/proto/</argument>
  438. <argument>--java_out=target/generated-test-sources/java</argument>
  439. <argument>src/test/proto/test.proto</argument>
  440. <argument>src/test/proto/test_rpc_service.proto</argument>
  441. </arguments>
  442. </configuration>
  443. </execution>
  444. </executions>
  445. </plugin>
  446. <plugin>
  447. <groupId>org.codehaus.mojo</groupId>
  448. <artifactId>build-helper-maven-plugin</artifactId>
  449. <executions>
  450. <execution>
  451. <id>add-source</id>
  452. <phase>generate-sources</phase>
  453. <goals>
  454. <goal>add-source</goal>
  455. </goals>
  456. <configuration>
  457. <sources>
  458. <source>${project.build.directory}/generated-sources/java</source>
  459. </sources>
  460. </configuration>
  461. </execution>
  462. <execution>
  463. <id>add-test-source</id>
  464. <phase>generate-sources</phase>
  465. <goals>
  466. <goal>add-test-source</goal>
  467. </goals>
  468. <configuration>
  469. <sources>
  470. <source>${project.build.directory}/generated-test-sources/java</source>
  471. </sources>
  472. </configuration>
  473. </execution>
  474. </executions>
  475. </plugin>
  476. <plugin>
  477. <groupId>org.apache.rat</groupId>
  478. <artifactId>apache-rat-plugin</artifactId>
  479. <configuration>
  480. <excludes>
  481. <exclude>CHANGES.txt</exclude>
  482. <exclude>.idea/**</exclude>
  483. <exclude>src/main/conf/*</exclude>
  484. <exclude>src/main/docs/**</exclude>
  485. <exclude>dev-support/jdiff/**</exclude>
  486. <exclude>src/main/native/*</exclude>
  487. <exclude>src/main/native/config/*</exclude>
  488. <exclude>src/main/native/m4/*</exclude>
  489. <exclude>src/test/empty-file</exclude>
  490. <exclude>src/test/all-tests</exclude>
  491. <exclude>src/test/resources/kdc/ldif/users.ldif</exclude>
  492. <exclude>src/main/native/src/org/apache/hadoop/io/compress/lz4/lz4.c</exclude>
  493. </excludes>
  494. </configuration>
  495. </plugin>
  496. <plugin>
  497. <groupId>org.apache.maven.plugins</groupId>
  498. <artifactId>maven-surefire-plugin</artifactId>
  499. <configuration>
  500. <properties>
  501. <property>
  502. <name>listener</name>
  503. <value>org.apache.hadoop.test.TimedOutTestsListener</value>
  504. </property>
  505. </properties>
  506. </configuration>
  507. </plugin>
  508. </plugins>
  509. </build>
  510. <profiles>
  511. <profile>
  512. <id>native</id>
  513. <activation>
  514. <activeByDefault>false</activeByDefault>
  515. </activation>
  516. <properties>
  517. <snappy.prefix></snappy.prefix>
  518. <snappy.lib></snappy.lib>
  519. <snappy.include></snappy.include>
  520. <require.snappy>false</require.snappy>
  521. </properties>
  522. <build>
  523. <plugins>
  524. <plugin>
  525. <groupId>org.apache.maven.plugins</groupId>
  526. <artifactId>maven-enforcer-plugin</artifactId>
  527. <executions>
  528. <execution>
  529. <id>enforce-os</id>
  530. <goals>
  531. <goal>enforce</goal>
  532. </goals>
  533. <configuration>
  534. <rules>
  535. <requireOS>
  536. <family>mac</family>
  537. <family>unix</family>
  538. <message>native build only supported on Mac or Unix</message>
  539. </requireOS>
  540. </rules>
  541. <fail>true</fail>
  542. </configuration>
  543. </execution>
  544. </executions>
  545. </plugin>
  546. <plugin>
  547. <groupId>org.codehaus.mojo</groupId>
  548. <artifactId>native-maven-plugin</artifactId>
  549. <executions>
  550. <execution>
  551. <phase>compile</phase>
  552. <goals>
  553. <goal>javah</goal>
  554. </goals>
  555. <configuration>
  556. <javahPath>${env.JAVA_HOME}/bin/javah</javahPath>
  557. <javahClassNames>
  558. <javahClassName>org.apache.hadoop.io.compress.zlib.ZlibCompressor</javahClassName>
  559. <javahClassName>org.apache.hadoop.io.compress.zlib.ZlibDecompressor</javahClassName>
  560. <javahClassName>org.apache.hadoop.security.JniBasedUnixGroupsMapping</javahClassName>
  561. <javahClassName>org.apache.hadoop.io.nativeio.NativeIO</javahClassName>
  562. <javahClassName>org.apache.hadoop.security.JniBasedUnixGroupsNetgroupMapping</javahClassName>
  563. <javahClassName>org.apache.hadoop.io.compress.snappy.SnappyCompressor</javahClassName>
  564. <javahClassName>org.apache.hadoop.io.compress.snappy.SnappyDecompressor</javahClassName>
  565. <javahClassName>org.apache.hadoop.io.compress.lz4.Lz4Compressor</javahClassName>
  566. <javahClassName>org.apache.hadoop.io.compress.lz4.Lz4Decompressor</javahClassName>
  567. <javahClassName>org.apache.hadoop.util.NativeCrc32</javahClassName>
  568. </javahClassNames>
  569. <javahOutputDirectory>${project.build.directory}/native/javah</javahOutputDirectory>
  570. </configuration>
  571. </execution>
  572. </executions>
  573. </plugin>
  574. <plugin>
  575. <groupId>org.apache.maven.plugins</groupId>
  576. <artifactId>maven-antrun-plugin</artifactId>
  577. <executions>
  578. <execution>
  579. <id>make</id>
  580. <phase>compile</phase>
  581. <goals><goal>run</goal></goals>
  582. <configuration>
  583. <target>
  584. <exec executable="cmake" dir="${project.build.directory}/native" failonerror="true">
  585. <arg line="${basedir}/src/ -DGENERATED_JAVAH=${project.build.directory}/native/javah -DJVM_ARCH_DATA_MODEL=${sun.arch.data.model} -DREQUIRE_SNAPPY=${require.snappy} -DCUSTOM_SNAPPY_PREFIX=${snappy.prefix} -DCUSTOM_SNAPPY_LIB=${snappy.lib} -DCUSTOM_SNAPPY_INCLUDE=${snappy.include}"/>
  586. </exec>
  587. <exec executable="make" dir="${project.build.directory}/native" failonerror="true">
  588. <arg line="VERBOSE=1"/>
  589. </exec>
  590. <!-- The second make is a workaround for HADOOP-9215. It can
  591. be removed when version 2.6 of cmake is no longer supported . -->
  592. <exec executable="make" dir="${project.build.directory}/native" failonerror="true"></exec>
  593. </target>
  594. </configuration>
  595. </execution>
  596. <execution>
  597. <id>native_tests</id>
  598. <phase>test</phase>
  599. <goals><goal>run</goal></goals>
  600. <configuration>
  601. <target>
  602. <exec executable="sh" failonerror="true" dir="${project.build.directory}/native">
  603. <arg value="-c"/>
  604. <arg value="[ x$SKIPTESTS = xtrue ] || ${project.build.directory}/native/test_bulk_crc32"/>
  605. <env key="SKIPTESTS" value="${skipTests}"/>
  606. </exec>
  607. </target>
  608. </configuration>
  609. </execution>
  610. </executions>
  611. </plugin>
  612. </plugins>
  613. </build>
  614. </profile>
  615. <profile>
  616. <id>native-win</id>
  617. <activation>
  618. <activeByDefault>false</activeByDefault>
  619. </activation>
  620. <build>
  621. <plugins>
  622. <plugin>
  623. <groupId>org.apache.maven.plugins</groupId>
  624. <artifactId>maven-enforcer-plugin</artifactId>
  625. <executions>
  626. <execution>
  627. <id>enforce-os</id>
  628. <goals>
  629. <goal>enforce</goal>
  630. </goals>
  631. <configuration>
  632. <rules>
  633. <requireOS>
  634. <family>windows</family>
  635. <message>native-win build only supported on Windows</message>
  636. </requireOS>
  637. </rules>
  638. <fail>true</fail>
  639. </configuration>
  640. </execution>
  641. </executions>
  642. </plugin>
  643. <plugin>
  644. <groupId>org.codehaus.mojo</groupId>
  645. <artifactId>native-maven-plugin</artifactId>
  646. <executions>
  647. <execution>
  648. <phase>compile</phase>
  649. <goals>
  650. <goal>javah</goal>
  651. </goals>
  652. <configuration>
  653. <javahPath>${env.JAVA_HOME}/bin/javah</javahPath>
  654. <javahClassNames>
  655. <javahClassName>org.apache.hadoop.io.compress.zlib.ZlibCompressor</javahClassName>
  656. <javahClassName>org.apache.hadoop.io.compress.zlib.ZlibDecompressor</javahClassName>
  657. <javahClassName>org.apache.hadoop.security.JniBasedUnixGroupsMapping</javahClassName>
  658. <javahClassName>org.apache.hadoop.io.nativeio.NativeIO</javahClassName>
  659. <javahClassName>org.apache.hadoop.security.JniBasedUnixGroupsNetgroupMapping</javahClassName>
  660. <javahClassName>org.apache.hadoop.io.compress.snappy.SnappyCompressor</javahClassName>
  661. <javahClassName>org.apache.hadoop.io.compress.snappy.SnappyDecompressor</javahClassName>
  662. <javahClassName>org.apache.hadoop.io.compress.lz4.Lz4Compressor</javahClassName>
  663. <javahClassName>org.apache.hadoop.io.compress.lz4.Lz4Decompressor</javahClassName>
  664. <javahClassName>org.apache.hadoop.util.NativeCrc32</javahClassName>
  665. </javahClassNames>
  666. <javahOutputDirectory>${project.build.directory}/native/javah</javahOutputDirectory>
  667. </configuration>
  668. </execution>
  669. </executions>
  670. </plugin>
  671. <plugin>
  672. <groupId>org.codehaus.mojo</groupId>
  673. <artifactId>exec-maven-plugin</artifactId>
  674. <executions>
  675. <execution>
  676. <id>compile-ms-winutils</id>
  677. <phase>compile</phase>
  678. <goals>
  679. <goal>exec</goal>
  680. </goals>
  681. <configuration>
  682. <executable>msbuild</executable>
  683. <arguments>
  684. <argument>${basedir}/src/main/winutils/winutils.sln</argument>
  685. <argument>/nologo</argument>
  686. <argument>/p:Configuration=Release</argument>
  687. <argument>/p:OutDir=${project.build.directory}/bin/</argument>
  688. </arguments>
  689. </configuration>
  690. </execution>
  691. <execution>
  692. <id>compile-ms-native-dll</id>
  693. <phase>compile</phase>
  694. <goals>
  695. <goal>exec</goal>
  696. </goals>
  697. <configuration>
  698. <executable>msbuild</executable>
  699. <arguments>
  700. <argument>${basedir}/src/main/native/native.sln</argument>
  701. <argument>/nologo</argument>
  702. <argument>/p:Configuration=Release</argument>
  703. <argument>/p:OutDir=${project.build.directory}/bin/</argument>
  704. </arguments>
  705. </configuration>
  706. </execution>
  707. </executions>
  708. </plugin>
  709. </plugins>
  710. </build>
  711. </profile>
  712. <!-- profile that starts ApacheDS KDC server -->
  713. <profile>
  714. <id>startKdc</id>
  715. <activation>
  716. <property>
  717. <name>startKdc</name>
  718. <value>true</value>
  719. </property>
  720. </activation>
  721. <build>
  722. <plugins>
  723. <plugin>
  724. <groupId>org.apache.maven.plugins</groupId>
  725. <artifactId>maven-enforcer-plugin</artifactId>
  726. <executions>
  727. <execution>
  728. <id>enforce-os</id>
  729. <goals>
  730. <goal>enforce</goal>
  731. </goals>
  732. <configuration>
  733. <rules>
  734. <!-- At present supports Mac and Unix OS family -->
  735. <requireOS>
  736. <family>mac</family>
  737. <family>unix</family>
  738. </requireOS>
  739. </rules>
  740. <fail>true</fail>
  741. </configuration>
  742. </execution>
  743. </executions>
  744. </plugin>
  745. <plugin>
  746. <groupId>org.apache.maven.plugins</groupId>
  747. <artifactId>maven-antrun-plugin</artifactId>
  748. <executions>
  749. <execution>
  750. <id>kdc</id>
  751. <phase>compile</phase>
  752. <goals>
  753. <goal>run</goal>
  754. </goals>
  755. <configuration>
  756. <target>
  757. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  758. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  759. <mkdir dir="${project.build.directory}/test-classes/kdc/downloads"/>
  760. <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"/>
  761. <untar src="${project.build.directory}/test-classes/kdc/downloads/apacheds-1.5.7.tar.gz" dest="${project.build.directory}/test-classes/kdc" compression="gzip" />
  762. <copy file="${kdc.resource.dir}/server.xml" toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/conf"/>
  763. <mkdir dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif"/>
  764. <copy toDir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/ldif">
  765. <fileset dir="${kdc.resource.dir}/ldif"/>
  766. </copy>
  767. <chmod file="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/apacheds.sh" perm="775" />
  768. <exec dir="${project.build.directory}/test-classes/kdc/apacheds_1.5.7/" executable="./apacheds.sh" spawn="true"/>
  769. </target>
  770. </configuration>
  771. </execution>
  772. <!-- On completion of graceful test phase: closes the ApacheDS KDC server -->
  773. <execution>
  774. <id>killKdc</id>
  775. <phase>test</phase>
  776. <goals>
  777. <goal>run</goal>
  778. </goals>
  779. <configuration>
  780. <target>
  781. <chmod file="${kdc.resource.dir}/killKdc.sh" perm="775" />
  782. <exec dir="${kdc.resource.dir}" executable= "./killKdc.sh" />
  783. </target>
  784. </configuration>
  785. </execution>
  786. </executions>
  787. </plugin>
  788. </plugins>
  789. </build>
  790. </profile>
  791. </profiles>
  792. </project>