pom.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  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>2.0.4-SNAPSHOT</version>
  22. <relativePath>../../hadoop-project-dist</relativePath>
  23. </parent>
  24. <groupId>org.apache.hadoop</groupId>
  25. <artifactId>hadoop-common</artifactId>
  26. <version>2.0.4-SNAPSHOT</version>
  27. <description>Apache Hadoop Common</description>
  28. <name>Apache Hadoop Common</name>
  29. <packaging>jar</packaging>
  30. <properties>
  31. <hadoop.component>common</hadoop.component>
  32. <is.hadoop.component>true</is.hadoop.component>
  33. </properties>
  34. <dependencies>
  35. <dependency>
  36. <groupId>org.apache.hadoop</groupId>
  37. <artifactId>hadoop-annotations</artifactId>
  38. <scope>compile</scope>
  39. </dependency>
  40. <dependency>
  41. <groupId>com.google.guava</groupId>
  42. <artifactId>guava</artifactId>
  43. <scope>compile</scope>
  44. </dependency>
  45. <dependency>
  46. <groupId>commons-cli</groupId>
  47. <artifactId>commons-cli</artifactId>
  48. <scope>compile</scope>
  49. </dependency>
  50. <dependency>
  51. <groupId>org.apache.commons</groupId>
  52. <artifactId>commons-math</artifactId>
  53. <scope>compile</scope>
  54. </dependency>
  55. <dependency>
  56. <groupId>xmlenc</groupId>
  57. <artifactId>xmlenc</artifactId>
  58. <scope>compile</scope>
  59. </dependency>
  60. <dependency>
  61. <groupId>commons-httpclient</groupId>
  62. <artifactId>commons-httpclient</artifactId>
  63. <scope>compile</scope>
  64. </dependency>
  65. <dependency>
  66. <groupId>commons-codec</groupId>
  67. <artifactId>commons-codec</artifactId>
  68. <scope>compile</scope>
  69. </dependency>
  70. <dependency>
  71. <groupId>commons-io</groupId>
  72. <artifactId>commons-io</artifactId>
  73. <scope>compile</scope>
  74. </dependency>
  75. <dependency>
  76. <groupId>commons-net</groupId>
  77. <artifactId>commons-net</artifactId>
  78. <scope>compile</scope>
  79. </dependency>
  80. <dependency>
  81. <groupId>javax.servlet</groupId>
  82. <artifactId>servlet-api</artifactId>
  83. <scope>compile</scope>
  84. </dependency>
  85. <dependency>
  86. <groupId>org.mortbay.jetty</groupId>
  87. <artifactId>jetty</artifactId>
  88. <scope>compile</scope>
  89. </dependency>
  90. <dependency>
  91. <groupId>org.mortbay.jetty</groupId>
  92. <artifactId>jetty-util</artifactId>
  93. <scope>compile</scope>
  94. </dependency>
  95. <dependency>
  96. <groupId>com.sun.jersey</groupId>
  97. <artifactId>jersey-core</artifactId>
  98. <scope>compile</scope>
  99. </dependency>
  100. <dependency>
  101. <!-- Used, even though 'mvn dependency:analyze' doesn't find it -->
  102. <groupId>com.sun.jersey</groupId>
  103. <artifactId>jersey-json</artifactId>
  104. <scope>compile</scope>
  105. </dependency>
  106. <dependency>
  107. <groupId>com.sun.jersey</groupId>
  108. <artifactId>jersey-server</artifactId>
  109. <scope>compile</scope>
  110. </dependency>
  111. <dependency>
  112. <groupId>tomcat</groupId>
  113. <artifactId>jasper-compiler</artifactId>
  114. <scope>runtime</scope>
  115. </dependency>
  116. <dependency>
  117. <groupId>tomcat</groupId>
  118. <artifactId>jasper-runtime</artifactId>
  119. <scope>runtime</scope>
  120. </dependency>
  121. <dependency>
  122. <groupId>javax.servlet.jsp</groupId>
  123. <artifactId>jsp-api</artifactId>
  124. <scope>runtime</scope>
  125. </dependency>
  126. <dependency>
  127. <groupId>commons-el</groupId>
  128. <artifactId>commons-el</artifactId>
  129. <scope>runtime</scope>
  130. </dependency>
  131. <dependency>
  132. <groupId>commons-logging</groupId>
  133. <artifactId>commons-logging</artifactId>
  134. <scope>compile</scope>
  135. </dependency>
  136. <dependency>
  137. <groupId>log4j</groupId>
  138. <artifactId>log4j</artifactId>
  139. <scope>compile</scope>
  140. </dependency>
  141. <dependency>
  142. <groupId>net.java.dev.jets3t</groupId>
  143. <artifactId>jets3t</artifactId>
  144. <scope>compile</scope>
  145. </dependency>
  146. <dependency>
  147. <groupId>junit</groupId>
  148. <artifactId>junit</artifactId>
  149. <scope>test</scope>
  150. </dependency>
  151. <dependency>
  152. <groupId>commons-lang</groupId>
  153. <artifactId>commons-lang</artifactId>
  154. <scope>compile</scope>
  155. </dependency>
  156. <dependency>
  157. <groupId>commons-configuration</groupId>
  158. <artifactId>commons-configuration</artifactId>
  159. <scope>compile</scope>
  160. </dependency>
  161. <dependency>
  162. <groupId>org.slf4j</groupId>
  163. <artifactId>slf4j-api</artifactId>
  164. <scope>compile</scope>
  165. </dependency>
  166. <dependency>
  167. <groupId>org.slf4j</groupId>
  168. <artifactId>slf4j-log4j12</artifactId>
  169. <scope>runtime</scope>
  170. </dependency>
  171. <dependency>
  172. <groupId>org.codehaus.jackson</groupId>
  173. <artifactId>jackson-core-asl</artifactId>
  174. <scope>compile</scope>
  175. </dependency>
  176. <dependency>
  177. <groupId>org.codehaus.jackson</groupId>
  178. <artifactId>jackson-mapper-asl</artifactId>
  179. <scope>compile</scope>
  180. </dependency>
  181. <dependency>
  182. <groupId>org.mockito</groupId>
  183. <artifactId>mockito-all</artifactId>
  184. <scope>test</scope>
  185. </dependency>
  186. <dependency>
  187. <groupId>org.apache.avro</groupId>
  188. <artifactId>avro</artifactId>
  189. <scope>compile</scope>
  190. </dependency>
  191. <dependency>
  192. <groupId>net.sf.kosmosfs</groupId>
  193. <artifactId>kfs</artifactId>
  194. <scope>compile</scope>
  195. </dependency>
  196. <dependency>
  197. <groupId>org.apache.ant</groupId>
  198. <artifactId>ant</artifactId>
  199. <scope>provided</scope>
  200. </dependency>
  201. <dependency>
  202. <groupId>com.google.protobuf</groupId>
  203. <artifactId>protobuf-java</artifactId>
  204. <scope>compile</scope>
  205. </dependency>
  206. <dependency>
  207. <groupId>org.apache.hadoop</groupId>
  208. <artifactId>hadoop-auth</artifactId>
  209. <scope>compile</scope>
  210. </dependency>
  211. <dependency>
  212. <groupId>com.jcraft</groupId>
  213. <artifactId>jsch</artifactId>
  214. </dependency>
  215. <dependency>
  216. <groupId>org.apache.zookeeper</groupId>
  217. <artifactId>zookeeper</artifactId>
  218. <version>3.4.2</version>
  219. <exclusions>
  220. <exclusion>
  221. <!-- otherwise seems to drag in junit 3.8.1 via jline -->
  222. <groupId>junit</groupId>
  223. <artifactId>junit</artifactId>
  224. </exclusion>
  225. <exclusion>
  226. <groupId>com.sun.jdmk</groupId>
  227. <artifactId>jmxtools</artifactId>
  228. </exclusion>
  229. <exclusion>
  230. <groupId>com.sun.jmx</groupId>
  231. <artifactId>jmxri</artifactId>
  232. </exclusion>
  233. </exclusions>
  234. </dependency>
  235. <dependency>
  236. <groupId>org.apache.zookeeper</groupId>
  237. <artifactId>zookeeper</artifactId>
  238. <version>3.4.2</version>
  239. <type>test-jar</type>
  240. <scope>test</scope>
  241. </dependency>
  242. </dependencies>
  243. <build>
  244. <!--
  245. Include all files in src/main/resources. By default, do not apply property
  246. substitution (filtering=false), but do apply property substitution to
  247. common-version-info.properties (filtering=true). This will substitute the
  248. version information correctly, but prevent Maven from altering other files
  249. like core-default.xml.
  250. -->
  251. <resources>
  252. <resource>
  253. <directory>${basedir}/src/main/resources</directory>
  254. <excludes>
  255. <exclude>common-version-info.properties</exclude>
  256. </excludes>
  257. <filtering>false</filtering>
  258. </resource>
  259. <resource>
  260. <directory>${basedir}/src/main/resources</directory>
  261. <includes>
  262. <include>common-version-info.properties</include>
  263. </includes>
  264. <filtering>true</filtering>
  265. </resource>
  266. </resources>
  267. <plugins>
  268. <plugin>
  269. <groupId>org.apache.hadoop</groupId>
  270. <artifactId>hadoop-maven-plugins</artifactId>
  271. <executions>
  272. <execution>
  273. <id>version-info</id>
  274. <goals>
  275. <goal>version-info</goal>
  276. </goals>
  277. <configuration>
  278. <source>
  279. <directory>${basedir}/src/main</directory>
  280. <includes>
  281. <include>java/**/*.java</include>
  282. <include>proto/**/*.proto</include>
  283. </includes>
  284. </source>
  285. </configuration>
  286. </execution>
  287. </executions>
  288. </plugin>
  289. <plugin>
  290. <groupId>org.apache.maven.plugins</groupId>
  291. <artifactId>maven-surefire-plugin</artifactId>
  292. <configuration>
  293. <systemPropertyVariables>
  294. <startKdc>${startKdc}</startKdc>
  295. <kdc.resource.dir>${kdc.resource.dir}</kdc.resource.dir>
  296. </systemPropertyVariables>
  297. </configuration>
  298. </plugin>
  299. <plugin>
  300. <groupId>org.apache.avro</groupId>
  301. <artifactId>avro-maven-plugin</artifactId>
  302. <executions>
  303. <execution>
  304. <id>generate-avro-test-sources</id>
  305. <phase>generate-test-sources</phase>
  306. <goals>
  307. <goal>schema</goal>
  308. </goals>
  309. </execution>
  310. </executions>
  311. <configuration>
  312. <testOutputDirectory>${project.build.directory}/generated-test-sources/java</testOutputDirectory>
  313. </configuration>
  314. </plugin>
  315. <plugin>
  316. <groupId>org.apache.maven.plugins</groupId>
  317. <artifactId>maven-antrun-plugin</artifactId>
  318. <executions>
  319. <execution>
  320. <id>create-protobuf-generated-sources-directory</id>
  321. <phase>initialize</phase>
  322. <goals>
  323. <goal>run</goal>
  324. </goals>
  325. <configuration>
  326. <target>
  327. <mkdir dir="target/generated-sources/java" />
  328. <mkdir dir="target/generated-test-sources/java" />
  329. </target>
  330. </configuration>
  331. </execution>
  332. <execution>
  333. <id>generate-test-sources</id>
  334. <phase>generate-test-sources</phase>
  335. <goals>
  336. <goal>run</goal>
  337. </goals>
  338. <configuration>
  339. <target>
  340. <mkdir dir="${project.build.directory}/generated-test-sources/java"/>
  341. <taskdef name="recordcc" classname="org.apache.hadoop.record.compiler.ant.RccTask">
  342. <classpath refid="maven.compile.classpath"/>
  343. </taskdef>
  344. <recordcc destdir="${project.build.directory}/generated-test-sources/java">
  345. <fileset dir="${basedir}/src/test/ddl" includes="**/*.jr"/>
  346. </recordcc>
  347. </target>
  348. </configuration>
  349. </execution>
  350. <execution>
  351. <id>create-log-dir</id>
  352. <phase>process-test-resources</phase>
  353. <goals>
  354. <goal>run</goal>
  355. </goals>
  356. <configuration>
  357. <target>
  358. <!--
  359. TODO: there are tests (TestLocalFileSystem#testCopy) that fail if data
  360. TODO: from a previous run is present
  361. -->
  362. <delete dir="${test.build.data}"/>
  363. <mkdir dir="${test.build.data}"/>
  364. <mkdir dir="${hadoop.log.dir}"/>
  365. <copy toDir="${project.build.directory}/test-classes">
  366. <fileset dir="${basedir}/src/main/conf"/>
  367. </copy>
  368. </target>
  369. </configuration>
  370. </execution>
  371. <execution>
  372. <phase>pre-site</phase>
  373. <goals>
  374. <goal>run</goal>
  375. </goals>
  376. <configuration>
  377. <tasks>
  378. <copy file="src/main/resources/core-default.xml" todir="src/site/resources"/>
  379. <copy file="src/main/xsl/configuration.xsl" todir="src/site/resources"/>
  380. </tasks>
  381. </configuration>
  382. </execution>
  383. </executions>
  384. </plugin>
  385. <plugin>
  386. <groupId>org.codehaus.mojo</groupId>
  387. <artifactId>exec-maven-plugin</artifactId>
  388. <executions>
  389. <execution>
  390. <id>compile-proto</id>
  391. <phase>generate-sources</phase>
  392. <goals>
  393. <goal>exec</goal>
  394. </goals>
  395. <configuration>
  396. <executable>protoc</executable>
  397. <arguments>
  398. <argument>-Isrc/main/proto/</argument>
  399. <argument>--java_out=target/generated-sources/java</argument>
  400. <argument>src/main/proto/HAServiceProtocol.proto</argument>
  401. <argument>src/main/proto/IpcConnectionContext.proto</argument>
  402. <argument>src/main/proto/ProtocolInfo.proto</argument>
  403. <argument>src/main/proto/RpcPayloadHeader.proto</argument>
  404. <argument>src/main/proto/ZKFCProtocol.proto</argument>
  405. <argument>src/main/proto/hadoop_rpc.proto</argument>
  406. <argument>src/main/proto/Security.proto</argument>
  407. </arguments>
  408. </configuration>
  409. </execution>
  410. <execution>
  411. <id>compile-test-proto</id>
  412. <phase>generate-test-sources</phase>
  413. <goals>
  414. <goal>exec</goal>
  415. </goals>
  416. <configuration>
  417. <executable>protoc</executable>
  418. <arguments>
  419. <argument>-Isrc/test/proto/</argument>
  420. <argument>--java_out=target/generated-test-sources/java</argument>
  421. <argument>src/test/proto/test.proto</argument>
  422. <argument>src/test/proto/test_rpc_service.proto</argument>
  423. </arguments>
  424. </configuration>
  425. </execution>
  426. </executions>
  427. </plugin>
  428. <plugin>
  429. <groupId>org.codehaus.mojo</groupId>
  430. <artifactId>build-helper-maven-plugin</artifactId>
  431. <executions>
  432. <execution>
  433. <id>add-source</id>
  434. <phase>generate-sources</phase>
  435. <goals>
  436. <goal>add-source</goal>
  437. </goals>
  438. <configuration>
  439. <sources>
  440. <source>${project.build.directory}/generated-sources/java</source>
  441. </sources>
  442. </configuration>
  443. </execution>
  444. <execution>
  445. <id>add-test-source</id>
  446. <phase>generate-sources</phase>
  447. <goals>
  448. <goal>add-test-source</goal>
  449. </goals>
  450. <configuration>
  451. <sources>
  452. <source>${project.build.directory}/generated-test-sources/java</source>
  453. </sources>
  454. </configuration>
  455. </execution>
  456. </executions>
  457. </plugin>
  458. <plugin>
  459. <groupId>org.apache.rat</groupId>
  460. <artifactId>apache-rat-plugin</artifactId>
  461. <configuration>
  462. <excludes>
  463. <exclude>CHANGES.txt</exclude>
  464. <exclude>.idea/**</exclude>
  465. <exclude>src/main/conf/*</exclude>
  466. <exclude>src/main/docs/**</exclude>
  467. <exclude>dev-support/jdiff/**</exclude>
  468. <exclude>src/main/native/*</exclude>
  469. <exclude>src/main/native/config/*</exclude>
  470. <exclude>src/main/native/m4/*</exclude>
  471. <exclude>src/test/empty-file</exclude>
  472. <exclude>src/test/all-tests</exclude>
  473. <exclude>src/test/resources/kdc/ldif/users.ldif</exclude>
  474. <exclude>src/main/native/src/org/apache/hadoop/io/compress/lz4/lz4.c</exclude>
  475. </excludes>
  476. </configuration>
  477. </plugin>
  478. <plugin>
  479. <groupId>org.apache.maven.plugins</groupId>
  480. <artifactId>maven-surefire-plugin</artifactId>
  481. <configuration>
  482. <properties>
  483. <property>
  484. <name>listener</name>
  485. <value>org.apache.hadoop.test.TimedOutTestsListener</value>
  486. </property>
  487. </properties>
  488. </configuration>
  489. </plugin>
  490. </plugins>
  491. </build>
  492. <profiles>
  493. <profile>
  494. <id>native</id>
  495. <activation>
  496. <activeByDefault>false</activeByDefault>
  497. </activation>
  498. <properties>
  499. <snappy.prefix></snappy.prefix>
  500. <snappy.lib></snappy.lib>
  501. <snappy.include></snappy.include>
  502. <require.snappy>false</require.snappy>
  503. </properties>
  504. <build>
  505. <plugins>
  506. <plugin>
  507. <groupId>org.codehaus.mojo</groupId>
  508. <artifactId>native-maven-plugin</artifactId>
  509. <executions>
  510. <execution>
  511. <phase>compile</phase>
  512. <goals>
  513. <goal>javah</goal>
  514. </goals>
  515. <configuration>
  516. <javahPath>${env.JAVA_HOME}/bin/javah</javahPath>
  517. <javahClassNames>
  518. <javahClassName>org.apache.hadoop.io.compress.zlib.ZlibCompressor</javahClassName>
  519. <javahClassName>org.apache.hadoop.io.compress.zlib.ZlibDecompressor</javahClassName>
  520. <javahClassName>org.apache.hadoop.security.JniBasedUnixGroupsMapping</javahClassName>
  521. <javahClassName>org.apache.hadoop.io.nativeio.NativeIO</javahClassName>
  522. <javahClassName>org.apache.hadoop.security.JniBasedUnixGroupsNetgroupMapping</javahClassName>
  523. <javahClassName>org.apache.hadoop.io.compress.snappy.SnappyCompressor</javahClassName>
  524. <javahClassName>org.apache.hadoop.io.compress.snappy.SnappyDecompressor</javahClassName>
  525. <javahClassName>org.apache.hadoop.io.compress.lz4.Lz4Compressor</javahClassName>
  526. <javahClassName>org.apache.hadoop.io.compress.lz4.Lz4Decompressor</javahClassName>
  527. <javahClassName>org.apache.hadoop.util.NativeCrc32</javahClassName>
  528. </javahClassNames>
  529. <javahOutputDirectory>${project.build.directory}/native/javah</javahOutputDirectory>
  530. </configuration>
  531. </execution>
  532. </executions>
  533. </plugin>
  534. <plugin>
  535. <groupId>org.apache.maven.plugins</groupId>
  536. <artifactId>maven-antrun-plugin</artifactId>
  537. <executions>
  538. <execution>
  539. <id>make</id>
  540. <phase>compile</phase>
  541. <goals><goal>run</goal></goals>
  542. <configuration>
  543. <target>
  544. <exec executable="cmake" dir="${project.build.directory}/native" failonerror="true">
  545. <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}"/>
  546. </exec>
  547. <exec executable="make" dir="${project.build.directory}/native" failonerror="true">
  548. <arg line="VERBOSE=1"/>
  549. </exec>
  550. <!-- The second make is a workaround for HADOOP-9215. It can
  551. be removed when version 2.6 of cmake is no longer supported . -->
  552. <exec executable="make" dir="${project.build.directory}/native" failonerror="true"></exec>
  553. </target>
  554. </configuration>
  555. </execution>
  556. <execution>
  557. <id>native_tests</id>
  558. <phase>test</phase>
  559. <goals><goal>run</goal></goals>
  560. <configuration>
  561. <target>
  562. <exec executable="sh" failonerror="true" dir="${project.build.directory}/native">
  563. <arg value="-c"/>
  564. <arg value="[ x$SKIPTESTS = xtrue ] || ${project.build.directory}/native/test_bulk_crc32"/>
  565. <env key="SKIPTESTS" value="${skipTests}"/>
  566. </exec>
  567. </target>
  568. </configuration>
  569. </execution>
  570. </executions>
  571. </plugin>
  572. </plugins>
  573. </build>
  574. </profile>
  575. </profiles>
  576. </project>