pom.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  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</artifactId>
  21. <version>2.9.0-SNAPSHOT</version>
  22. <relativePath>../hadoop-project</relativePath>
  23. </parent>
  24. <groupId>org.apache.hadoop</groupId>
  25. <artifactId>hadoop-project-dist</artifactId>
  26. <version>2.9.0-SNAPSHOT</version>
  27. <description>Apache Hadoop Project Dist POM</description>
  28. <name>Apache Hadoop Project Dist POM</name>
  29. <packaging>pom</packaging>
  30. <properties>
  31. <hadoop.tmp.dir>${project.build.directory}/test</hadoop.tmp.dir>
  32. <test.build.data>${project.build.directory}/test/data</test.build.data>
  33. <hadoop.log.dir>${project.build.directory}/log</hadoop.log.dir>
  34. <test.build.webapps>${project.build.directory}/test-classes/webapps</test.build.webapps>
  35. <test.cache.data>${project.build.directory}/test-classes</test.cache.data>
  36. <test.build.classes>${project.build.directory}/test-classes</test.build.classes>
  37. <hadoop.component>UNDEF</hadoop.component>
  38. <bundle.snappy>false</bundle.snappy>
  39. <bundle.snappy.in.bin>false</bundle.snappy.in.bin>
  40. <bundle.openssl>false</bundle.openssl>
  41. <bundle.openssl.in.bin>false</bundle.openssl.in.bin>
  42. </properties>
  43. <dependencies>
  44. <dependency>
  45. <groupId>org.apache.hadoop</groupId>
  46. <artifactId>hadoop-annotations</artifactId>
  47. <scope>provided</scope>
  48. </dependency>
  49. </dependencies>
  50. <build>
  51. <plugins>
  52. <plugin>
  53. <groupId>org.apache.maven.plugins</groupId>
  54. <artifactId>maven-jar-plugin</artifactId>
  55. <executions>
  56. <execution>
  57. <id>prepare-jar</id>
  58. <phase>prepare-package</phase>
  59. <goals>
  60. <goal>jar</goal>
  61. </goals>
  62. </execution>
  63. <execution>
  64. <id>prepare-test-jar</id>
  65. <phase>prepare-package</phase>
  66. <goals>
  67. <goal>test-jar</goal>
  68. </goals>
  69. <configuration>
  70. <includes>
  71. <include>**/*.class</include>
  72. <include>webapps/**</include>
  73. </includes>
  74. </configuration>
  75. </execution>
  76. </executions>
  77. </plugin>
  78. <plugin>
  79. <groupId>org.apache.maven.plugins</groupId>
  80. <artifactId>maven-source-plugin</artifactId>
  81. <executions>
  82. <execution>
  83. <phase>prepare-package</phase>
  84. <goals>
  85. <goal>jar</goal>
  86. <goal>test-jar</goal>
  87. </goals>
  88. </execution>
  89. </executions>
  90. <configuration>
  91. <attach>true</attach>
  92. </configuration>
  93. </plugin>
  94. <plugin>
  95. <groupId>org.codehaus.mojo</groupId>
  96. <artifactId>findbugs-maven-plugin</artifactId>
  97. <configuration>
  98. <excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
  99. <fork>true</fork>
  100. <maxHeap>2048</maxHeap>
  101. </configuration>
  102. </plugin>
  103. <plugin>
  104. <groupId>org.apache.maven.plugins</groupId>
  105. <artifactId>maven-javadoc-plugin</artifactId>
  106. <configuration>
  107. <linksource>true</linksource>
  108. <maxmemory>512m</maxmemory>
  109. <quiet>true</quiet>
  110. <verbose>false</verbose>
  111. <source>${maven.compile.source}</source>
  112. <charset>${maven.compile.encoding}</charset>
  113. <reportOutputDirectory>${project.build.directory}/site</reportOutputDirectory>
  114. <destDir>api</destDir>
  115. <groups>
  116. <group>
  117. <title>${project.name} API</title>
  118. <packages>org.apache.hadoop*</packages>
  119. </group>
  120. </groups>
  121. <doclet>org.apache.hadoop.classification.tools.ExcludePrivateAnnotationsStandardDoclet</doclet>
  122. <docletArtifacts>
  123. <docletArtifact>
  124. <groupId>org.apache.hadoop</groupId>
  125. <artifactId>hadoop-annotations</artifactId>
  126. <version>${project.version}</version>
  127. </docletArtifact>
  128. </docletArtifacts>
  129. <useStandardDocletOptions>true</useStandardDocletOptions>
  130. <!-- switch on dependency-driven aggregation -->
  131. <includeDependencySources>false</includeDependencySources>
  132. <dependencySourceIncludes>
  133. <!-- include ONLY dependencies I control -->
  134. <dependencySourceInclude>org.apache.hadoop:hadoop-annotations</dependencySourceInclude>
  135. </dependencySourceIncludes>
  136. </configuration>
  137. </plugin>
  138. </plugins>
  139. </build>
  140. <profiles>
  141. <profile>
  142. <id>docs</id>
  143. <activation>
  144. <activeByDefault>false</activeByDefault>
  145. </activation>
  146. <properties>
  147. <jdiff.stable.api>2.6.0</jdiff.stable.api>
  148. <jdiff.stability>-unstable</jdiff.stability>
  149. <!-- Commented out for HADOOP-11776 -->
  150. <!-- Uncomment param name="${jdiff.compatibility}" in javadoc doclet if compatibility is not empty -->
  151. <jdiff.compatibility></jdiff.compatibility>
  152. <jdiff.javadoc.maxmemory>512m</jdiff.javadoc.maxmemory>
  153. </properties>
  154. <build>
  155. <plugins>
  156. <plugin>
  157. <groupId>org.apache.maven.plugins</groupId>
  158. <artifactId>maven-javadoc-plugin</artifactId>
  159. <executions>
  160. <execution>
  161. <goals>
  162. <goal>javadoc</goal>
  163. </goals>
  164. <phase>prepare-package</phase>
  165. </execution>
  166. </executions>
  167. </plugin>
  168. <plugin>
  169. <groupId>org.codehaus.mojo</groupId>
  170. <artifactId>findbugs-maven-plugin</artifactId>
  171. <executions>
  172. <execution>
  173. <goals>
  174. <goal>findbugs</goal>
  175. </goals>
  176. <phase>prepare-package</phase>
  177. </execution>
  178. </executions>
  179. <configuration>
  180. <excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
  181. </configuration>
  182. </plugin>
  183. <plugin>
  184. <groupId>org.apache.maven.plugins</groupId>
  185. <artifactId>maven-dependency-plugin</artifactId>
  186. <executions>
  187. <execution>
  188. <id>site</id>
  189. <phase>prepare-package</phase>
  190. <goals>
  191. <goal>copy</goal>
  192. </goals>
  193. <configuration>
  194. <artifactItems>
  195. <artifactItem>
  196. <groupId>jdiff</groupId>
  197. <artifactId>jdiff</artifactId>
  198. <version>${jdiff.version}</version>
  199. <overWrite>false</overWrite>
  200. <outputDirectory>${project.build.directory}</outputDirectory>
  201. <destFileName>jdiff.jar</destFileName>
  202. </artifactItem>
  203. <artifactItem>
  204. <groupId>org.apache.hadoop</groupId>
  205. <artifactId>hadoop-annotations</artifactId>
  206. <version>${project.version}</version>
  207. <overWrite>false</overWrite>
  208. <outputDirectory>${project.build.directory}</outputDirectory>
  209. <destFileName>hadoop-annotations.jar</destFileName>
  210. </artifactItem>
  211. <artifactItem>
  212. <groupId>xerces</groupId>
  213. <artifactId>xercesImpl</artifactId>
  214. <version>${xerces.jdiff.version}</version>
  215. <overWrite>false</overWrite>
  216. <outputDirectory>${project.build.directory}</outputDirectory>
  217. <destFileName>xerces.jar</destFileName>
  218. </artifactItem>
  219. </artifactItems>
  220. </configuration>
  221. </execution>
  222. </executions>
  223. </plugin>
  224. <plugin>
  225. <groupId>org.apache.maven.plugins</groupId>
  226. <artifactId>maven-antrun-plugin</artifactId>
  227. <executions>
  228. <execution>
  229. <id>site</id>
  230. <phase>prepare-package</phase>
  231. <goals>
  232. <goal>run</goal>
  233. </goals>
  234. <configuration>
  235. <target if="is.hadoop.component">
  236. <mkdir dir="${project.build.directory}/docs-src"/>
  237. <!-- Docs -->
  238. <style basedir="${basedir}/src/main/resources"
  239. destdir="${project.build.directory}/site"
  240. includes="core-default.xml"
  241. style="${basedir}/src/main/xsl/configuration.xsl"/>
  242. <!-- Jdiff -->
  243. <mkdir dir="${project.build.directory}/site/jdiff/xml"/>
  244. <javadoc maxmemory="${jdiff.javadoc.maxmemory}" verbose="yes">
  245. <doclet name="org.apache.hadoop.classification.tools.ExcludePrivateAnnotationsJDiffDoclet"
  246. path="${project.build.directory}/hadoop-annotations.jar:${project.build.directory}/jdiff.jar">
  247. <param name="-apidir" value="${project.build.directory}/site/jdiff/xml"/>
  248. <param name="-apiname" value="${project.name} ${project.version}"/>
  249. <param name="${jdiff.stability}"/>
  250. </doclet>
  251. <packageset dir="${basedir}/src/main/java"/>
  252. <classpath>
  253. <path refid="maven.compile.classpath"/>
  254. </classpath>
  255. </javadoc>
  256. <javadoc sourcepath="${basedir}/src/main/java"
  257. destdir="${project.build.directory}/site/jdiff/xml"
  258. sourceFiles="${basedir}/dev-support/jdiff/Null.java"
  259. maxmemory="${jdiff.javadoc.maxmemory}">
  260. <doclet name="org.apache.hadoop.classification.tools.ExcludePrivateAnnotationsJDiffDoclet"
  261. path="${project.build.directory}/hadoop-annotations.jar:${project.build.directory}/jdiff.jar:${project.build.directory}/xerces.jar">
  262. <param name="-oldapi" value="${project.name} ${jdiff.stable.api}"/>
  263. <param name="-newapi" value="${project.name} ${project.version}"/>
  264. <param name="-oldapidir" value="${basedir}/dev-support/jdiff"/>
  265. <param name="-newapidir" value="${project.build.directory}/site/jdiff/xml"/>
  266. <param name="-javadocold"
  267. value="http://hadoop.apache.org/docs/r${jdiff.stable.api}/api/"/>
  268. <param name="-javadocnew" value="${project.build.directory}/site/api"/>
  269. <param name="-stats"/>
  270. <param name="${jdiff.stability}"/>
  271. <!--param name="${jdiff.compatibility}"/-->
  272. </doclet>
  273. <classpath>
  274. <path refid="maven.compile.classpath"/>
  275. </classpath>
  276. </javadoc>
  277. <xslt style="${env.FINDBUGS_HOME}/src/xsl/default.xsl"
  278. in="${project.build.directory}/findbugsXml.xml"
  279. out="${project.build.directory}/site/findbugs.html"/>
  280. </target>
  281. </configuration>
  282. </execution>
  283. </executions>
  284. </plugin>
  285. </plugins>
  286. </build>
  287. </profile>
  288. <profile>
  289. <id>dist</id>
  290. <activation>
  291. <activeByDefault>false</activeByDefault>
  292. </activation>
  293. <build>
  294. <plugins>
  295. <plugin>
  296. <groupId>org.apache.maven.plugins</groupId>
  297. <artifactId>maven-antrun-plugin</artifactId>
  298. <executions>
  299. <execution>
  300. <id>pre-dist</id>
  301. <phase>prepare-package</phase>
  302. <goals>
  303. <goal>run</goal>
  304. </goals>
  305. <configuration>
  306. <target>
  307. <!-- Using Unix script to preserve symlinks -->
  308. <echo file="${project.build.directory}/dist-copynativelibs.sh">
  309. # Bundle a native library if requested. Exit 1 in case error happens.
  310. # Usage: bundle_native_lib bundleOption libOption libPattern libDir
  311. function bundle_native_lib() {
  312. bundleOption="$1"
  313. libOption="$2"
  314. libPattern="$3"
  315. libDir="$4"
  316. echo "Checking to bundle with:"
  317. echo "bundleOption=${bundleOption}, libOption=${libOption}, libDir=${libDir}, pattern=${libPattern}"
  318. if [[ "${bundleOption}" != "true" ]]; then
  319. return
  320. fi
  321. if [[ -z "${libDir}" ]] || [[ ! -d ${libDir} ]]; then
  322. echo "The required option $libOption isn't given or invalid. Bundling the lib failed"
  323. exit 1
  324. fi
  325. cd "$libDir"
  326. $$TAR *$libPattern* | (cd $${TARGET_DIR}/; $$UNTAR)
  327. if [[ $? -ne 0 ]]; then
  328. echo "Bundling library with ${libOption} failed "
  329. exit 1
  330. fi
  331. }
  332. BUILD_DIR="${project.build.directory}"
  333. TAR='tar cf -'
  334. UNTAR='tar xfBp -'
  335. LIB_DIR="${BUILD_DIR}/native/target/usr/local/lib"
  336. set -o pipefail
  337. if [[ -d $${LIB_DIR} ]]; then
  338. TARGET_DIR="${BUILD_DIR}/${project.artifactId}-${project.version}/lib/native"
  339. mkdir -p $${TARGET_DIR}
  340. cd $${LIB_DIR}
  341. $$TAR lib* | (cd $${TARGET_DIR}/; $$UNTAR)
  342. if [[ $? -ne 0 ]]; then
  343. echo "Bundling lib files failed"
  344. exit 1
  345. fi
  346. echo bundle_native_lib "${bundle.snappy}" "snappy.lib" "snappy" "${snappy.lib}"
  347. bundle_native_lib "${bundle.snappy}" "snappy.lib" "snappy" "${snappy.lib}"
  348. echo bundle_native_lib "${bundle.openssl}" "openssl.lib" "crypto" "${openssl.lib}"
  349. bundle_native_lib "${bundle.openssl}" "openssl.lib" "crypto" "${openssl.lib}"
  350. fi
  351. BIN_DIR="${BUILD_DIR}/bin"
  352. if [[ -d $${BIN_DIR} ]] ; then
  353. TARGET_BIN_DIR="${BUILD_DIR}/${project.artifactId}-${project.version}/bin"
  354. mkdir -p $${TARGET_BIN_DIR}
  355. cd $${BIN_DIR}
  356. $$TAR * | (cd $${TARGET_BIN_DIR}/; $$UNTAR)
  357. if [[ $? -ne 0 ]]; then
  358. echo "Bundling bin files failed"
  359. exit 1
  360. fi
  361. if [[ "${bundle.snappy.in.bin}" == "true" ]]; then
  362. if [[ "${bundle.snappy}" == "true" ]]; then
  363. cd "${snappy.lib}"
  364. $$TAR *snappy* | (cd $${TARGET_BIN_DIR}/; $$UNTAR)
  365. if [[ $? -ne 0 ]]; then
  366. echo "Bundling snappy bin files failed"
  367. exit 1
  368. fi
  369. fi
  370. fi
  371. if [[ "${bundle.openssl.in.bin}" == "true" ]]; then
  372. if [[ "${bundle.openssl}" == "true" ]]; then
  373. cd "${openssl.lib}"
  374. $$TAR *crypto* | (cd $${TARGET_BIN_DIR}/; $$UNTAR)
  375. if [[ $? -ne 0 ]]; then
  376. echo "Bundling openssl bin files failed"
  377. exit 1
  378. fi
  379. fi
  380. fi
  381. fi
  382. </echo>
  383. <exec executable="${shell-executable}" dir="${project.build.directory}" failonerror="true">
  384. <arg line="./dist-copynativelibs.sh"/>
  385. </exec>
  386. </target>
  387. </configuration>
  388. </execution>
  389. <execution>
  390. <id>tar</id>
  391. <phase>package</phase>
  392. <goals>
  393. <goal>run</goal>
  394. </goals>
  395. <configuration>
  396. <target if="tar">
  397. <!-- Using Unix script to preserve symlinks -->
  398. <echo file="${project.build.directory}/dist-maketar.sh">
  399. cd "${project.build.directory}"
  400. tar cf - ${project.artifactId}-${project.version} | gzip > ${project.artifactId}-${project.version}.tar.gz
  401. </echo>
  402. <exec executable="${shell-executable}" dir="${project.build.directory}" failonerror="true">
  403. <arg line="./dist-maketar.sh"/>
  404. </exec>
  405. </target>
  406. </configuration>
  407. </execution>
  408. </executions>
  409. </plugin>
  410. <plugin>
  411. <groupId>org.apache.maven.plugins</groupId>
  412. <artifactId>maven-assembly-plugin</artifactId>
  413. <dependencies>
  414. <dependency>
  415. <groupId>org.apache.hadoop</groupId>
  416. <artifactId>hadoop-assemblies</artifactId>
  417. <version>${project.version}</version>
  418. </dependency>
  419. </dependencies>
  420. <executions>
  421. <execution>
  422. <id>dist</id>
  423. <phase>prepare-package</phase>
  424. <goals>
  425. <goal>single</goal>
  426. </goals>
  427. <configuration>
  428. <appendAssemblyId>false</appendAssemblyId>
  429. <attach>false</attach>
  430. <finalName>${project.artifactId}-${project.version}</finalName>
  431. <descriptorRefs>
  432. <descriptorRef>hadoop-dist</descriptorRef>
  433. </descriptorRefs>
  434. </configuration>
  435. </execution>
  436. </executions>
  437. </plugin>
  438. </plugins>
  439. </build>
  440. </profile>
  441. </profiles>
  442. </project>