pom.xml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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. <parent>
  18. <artifactId>hadoop-mapreduce-client</artifactId>
  19. <groupId>org.apache.hadoop</groupId>
  20. <version>3.0.0-SNAPSHOT</version>
  21. </parent>
  22. <modelVersion>4.0.0</modelVersion>
  23. <groupId>org.apache.hadoop</groupId>
  24. <artifactId>hadoop-mapreduce-client-nativetask</artifactId>
  25. <version>3.0.0-SNAPSHOT</version>
  26. <name>hadoop-mapreduce-client-nativetask</name>
  27. <properties>
  28. <!-- Needed for generating FindBugs warnings using parent pom -->
  29. <mr.basedir>${project.parent.basedir}/../</mr.basedir>
  30. </properties>
  31. <dependencies>
  32. <dependency>
  33. <groupId>org.apache.hadoop</groupId>
  34. <artifactId>hadoop-common</artifactId>
  35. </dependency>
  36. <dependency>
  37. <groupId>org.apache.hadoop</groupId>
  38. <artifactId>hadoop-mapreduce-client-core</artifactId>
  39. </dependency>
  40. <dependency>
  41. <groupId>org.apache.avro</groupId>
  42. <artifactId>avro</artifactId>
  43. <scope>test</scope>
  44. </dependency>
  45. <dependency>
  46. <groupId>junit</groupId>
  47. <artifactId>junit</artifactId>
  48. <scope>test</scope>
  49. </dependency>
  50. <dependency>
  51. <groupId>org.mockito</groupId>
  52. <artifactId>mockito-all</artifactId>
  53. <scope>test</scope>
  54. </dependency>
  55. <dependency>
  56. <groupId>org.apache.hadoop</groupId>
  57. <artifactId>hadoop-common</artifactId>
  58. <type>test-jar</type>
  59. <scope>test</scope>
  60. </dependency>
  61. <dependency>
  62. <groupId>org.apache.hadoop</groupId>
  63. <artifactId>hadoop-mapreduce-client-common</artifactId>
  64. <scope>test</scope>
  65. </dependency>
  66. </dependencies>
  67. <build>
  68. <plugins>
  69. <plugin>
  70. <groupId>org.apache.maven.plugins</groupId>
  71. <artifactId>maven-surefire-plugin</artifactId>
  72. <configuration>
  73. <properties>
  74. <property>
  75. <name>listener</name>
  76. <value>org.apache.hadoop.test.TimedOutTestsListener</value>
  77. </property>
  78. </properties>
  79. <includes>
  80. <include>**/TestTaskContext.java</include>
  81. <include>**/buffer/Test*.java</include>
  82. <include>**/handlers/Test*.java</include>
  83. <include>**/serde/Test*.java</include>
  84. </includes>
  85. </configuration>
  86. </plugin>
  87. </plugins>
  88. </build>
  89. <profiles>
  90. <profile>
  91. <id>native</id>
  92. <activation>
  93. <activeByDefault>false</activeByDefault>
  94. </activation>
  95. <properties>
  96. <snappy.prefix></snappy.prefix>
  97. <snappy.lib></snappy.lib>
  98. <snappy.include></snappy.include>
  99. <require.snappy>false</require.snappy>
  100. </properties>
  101. <build>
  102. <plugins>
  103. <plugin>
  104. <groupId>org.apache.maven.plugins</groupId>
  105. <artifactId>maven-enforcer-plugin</artifactId>
  106. <executions>
  107. <execution>
  108. <id>enforce-os</id>
  109. <goals>
  110. <goal>enforce</goal>
  111. </goals>
  112. <configuration>
  113. <rules>
  114. <requireOS>
  115. <family>mac</family>
  116. <family>unix</family>
  117. <message>native build only supported on Mac or
  118. Unix</message>
  119. </requireOS>
  120. </rules>
  121. <fail>true</fail>
  122. </configuration>
  123. </execution>
  124. </executions>
  125. </plugin>
  126. <plugin>
  127. <groupId>org.codehaus.mojo</groupId>
  128. <artifactId>native-maven-plugin</artifactId>
  129. <executions>
  130. <execution>
  131. <phase>compile</phase>
  132. <goals>
  133. <goal>javah</goal>
  134. </goals>
  135. <configuration>
  136. <javahPath>${env.JAVA_HOME}/bin/javah</javahPath>
  137. <javahClassNames>
  138. <javaClassName>org.apache.hadoop.mapred.nativetask.NativeBatchProcessor</javaClassName>
  139. <javaClassName>org.apache.hadoop.mapred.nativetask.NativeRuntime</javaClassName>
  140. </javahClassNames>
  141. <javahOutputDirectory>${project.build.directory}/native/javah</javahOutputDirectory>
  142. </configuration>
  143. </execution>
  144. </executions>
  145. </plugin>
  146. <plugin>
  147. <groupId>org.apache.maven.plugins</groupId>
  148. <artifactId>maven-antrun-plugin</artifactId>
  149. <executions>
  150. <execution>
  151. <id>make</id>
  152. <phase>compile</phase>
  153. <goals>
  154. <goal>run</goal>
  155. </goals>
  156. <configuration>
  157. <target>
  158. <copy file="${basedir}/../../../hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/lz4/lz4.h"
  159. todir="${project.build.directory}/native/" />
  160. <copy file="${basedir}/../../../hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/lz4/lz4_encoder.h"
  161. todir="${project.build.directory}/native/" />
  162. <copy file="${basedir}/../../../hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/lz4/lz4.c"
  163. todir="${project.build.directory}/native/" />
  164. <copy todir="${project.build.directory}/native/test/testData"
  165. overwrite="true">
  166. <fileset dir="${basedir}/src/main/native/testData" />
  167. </copy>
  168. <exec executable="cmake" dir="${project.build.directory}/native"
  169. failonerror="true">
  170. <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}" />
  171. </exec>
  172. <exec executable="make" dir="${project.build.directory}/native" failonerror="true">
  173. <arg line="VERBOSE=1" />
  174. </exec>
  175. <!-- The second make is a workaround for HADOOP-9215. It can be
  176. removed when version 2.6 of cmake is no longer supported . -->
  177. <exec executable="make" dir="${project.build.directory}/native" failonerror="true"></exec>
  178. </target>
  179. </configuration>
  180. </execution>
  181. <execution>
  182. <id>native_tests</id>
  183. <phase>test</phase>
  184. <goals><goal>run</goal></goals>
  185. <configuration>
  186. <target>
  187. <exec executable="sh" failonerror="true" dir="${project.build.directory}/native/test">
  188. <arg value="-c"/>
  189. <arg value="[ x$SKIPTESTS = xtrue ] || sh test.sh"/>
  190. <env key="SKIPTESTS" value="${skipTests}"/>
  191. </exec>
  192. </target>
  193. </configuration>
  194. </execution>
  195. </executions>
  196. </plugin>
  197. <plugin>
  198. <groupId>org.apache.maven.plugins</groupId>
  199. <artifactId>maven-surefire-plugin</artifactId>
  200. <configuration>
  201. <properties>
  202. <property>
  203. <name>listener</name>
  204. <value>org.apache.hadoop.test.TimedOutTestsListener</value>
  205. </property>
  206. </properties>
  207. <includes>
  208. <include>**/TestTaskContext.java</include>
  209. <include>**/buffer/Test*.java</include>
  210. <include>**/handlers/Test*.java</include>
  211. <include>**/serde/Test*.java</include>
  212. <include>**/combinertest/*Test.java</include>
  213. <include>**/compresstest/*Test.java</include>
  214. <include>**/nonsorttest/*Test.java</include>
  215. <include>**/kvtest/*Test.java</include>
  216. </includes>
  217. </configuration>
  218. </plugin>
  219. </plugins>
  220. </build>
  221. </profile>
  222. </profiles>
  223. </project>