pom.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  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. <copy todir="${project.build.directory}/docs-src">
  238. <fileset dir="${basedir}/src/main/docs"/>
  239. </copy>
  240. <!-- Docs -->
  241. <copy file="${project.build.directory}/docs-src/releasenotes.html"
  242. todir="${project.build.directory}/site"/>
  243. <style basedir="${basedir}/src/main/resources"
  244. destdir="${project.build.directory}/site"
  245. includes="core-default.xml"
  246. style="${basedir}/src/main/xsl/configuration.xsl"/>
  247. <!-- Convert 'CHANGES.txt' to 'changes.html" -->
  248. <exec executable="perl" input="${basedir}/../CHANGES.txt"
  249. output="${project.build.directory}/site/changes.html"
  250. failonerror="true">
  251. <arg value="${project.build.directory}/docs-src/changes/changes2html.pl"/>
  252. </exec>
  253. <copy todir="${project.build.directory}/site">
  254. <fileset dir="${project.build.directory}/docs-src/changes" includes="*.css"/>
  255. </copy>
  256. <!-- Jdiff -->
  257. <mkdir dir="${project.build.directory}/site/jdiff/xml"/>
  258. <javadoc maxmemory="${jdiff.javadoc.maxmemory}" verbose="yes">
  259. <doclet name="org.apache.hadoop.classification.tools.ExcludePrivateAnnotationsJDiffDoclet"
  260. path="${project.build.directory}/hadoop-annotations.jar:${project.build.directory}/jdiff.jar">
  261. <param name="-apidir" value="${project.build.directory}/site/jdiff/xml"/>
  262. <param name="-apiname" value="${project.name} ${project.version}"/>
  263. <param name="${jdiff.stability}"/>
  264. </doclet>
  265. <packageset dir="${basedir}/src/main/java"/>
  266. <classpath>
  267. <path refid="maven.compile.classpath"/>
  268. </classpath>
  269. </javadoc>
  270. <javadoc sourcepath="${basedir}/src/main/java"
  271. destdir="${project.build.directory}/site/jdiff/xml"
  272. sourceFiles="${basedir}/dev-support/jdiff/Null.java"
  273. maxmemory="${jdiff.javadoc.maxmemory}">
  274. <doclet name="org.apache.hadoop.classification.tools.ExcludePrivateAnnotationsJDiffDoclet"
  275. path="${project.build.directory}/hadoop-annotations.jar:${project.build.directory}/jdiff.jar:${project.build.directory}/xerces.jar">
  276. <param name="-oldapi" value="${project.name} ${jdiff.stable.api}"/>
  277. <param name="-newapi" value="${project.name} ${project.version}"/>
  278. <param name="-oldapidir" value="${basedir}/dev-support/jdiff"/>
  279. <param name="-newapidir" value="${project.build.directory}/site/jdiff/xml"/>
  280. <param name="-javadocold"
  281. value="http://hadoop.apache.org/docs/r${jdiff.stable.api}/api/"/>
  282. <param name="-javadocnew" value="${project.build.directory}/site/api"/>
  283. <param name="-stats"/>
  284. <param name="${jdiff.stability}"/>
  285. <!--param name="${jdiff.compatibility}"/-->
  286. </doclet>
  287. <classpath>
  288. <path refid="maven.compile.classpath"/>
  289. </classpath>
  290. </javadoc>
  291. <xslt style="${env.FINDBUGS_HOME}/src/xsl/default.xsl"
  292. in="${project.build.directory}/findbugsXml.xml"
  293. out="${project.build.directory}/site/findbugs.html"/>
  294. </target>
  295. </configuration>
  296. </execution>
  297. </executions>
  298. </plugin>
  299. </plugins>
  300. </build>
  301. </profile>
  302. <profile>
  303. <id>dist</id>
  304. <activation>
  305. <activeByDefault>false</activeByDefault>
  306. </activation>
  307. <build>
  308. <plugins>
  309. <plugin>
  310. <groupId>org.apache.maven.plugins</groupId>
  311. <artifactId>maven-antrun-plugin</artifactId>
  312. <executions>
  313. <execution>
  314. <id>pre-dist</id>
  315. <phase>prepare-package</phase>
  316. <goals>
  317. <goal>run</goal>
  318. </goals>
  319. <configuration>
  320. <target>
  321. <!-- Using Unix script to preserve symlinks -->
  322. <echo file="${project.build.directory}/dist-copynativelibs.sh">
  323. # Bundle a native library if requested. Exit 1 in case error happens.
  324. # Usage: bundle_native_lib bundleOption libOption libPattern libDir
  325. function bundle_native_lib() {
  326. bundleOption="$1"
  327. libOption="$2"
  328. libPattern="$3"
  329. libDir="$4"
  330. echo "Checking to bundle with:"
  331. echo "bundleOption=${bundleOption}, libOption=${libOption}, libDir=${libDir}, pattern=${libPattern}"
  332. if [[ "${bundleOption}" != "true" ]]; then
  333. return
  334. fi
  335. if [[ -z "${libDir}" ]] || [[ ! -d ${libDir} ]]; then
  336. echo "The required option $libOption isn't given or invalid. Bundling the lib failed"
  337. exit 1
  338. fi
  339. cd "$libDir"
  340. $$TAR *$libPattern* | (cd $${TARGET_DIR}/; $$UNTAR)
  341. if [[ $? -ne 0 ]]; then
  342. echo "Bundling library with ${libOption} failed "
  343. exit 1
  344. fi
  345. }
  346. BUILD_DIR="${project.build.directory}"
  347. TAR='tar cf -'
  348. UNTAR='tar xfBp -'
  349. LIB_DIR="${BUILD_DIR}/native/target/usr/local/lib"
  350. set -o pipefail
  351. if [[ -d $${LIB_DIR} ]]; then
  352. TARGET_DIR="${BUILD_DIR}/${project.artifactId}-${project.version}/lib/native"
  353. mkdir -p $${TARGET_DIR}
  354. cd $${LIB_DIR}
  355. $$TAR lib* | (cd $${TARGET_DIR}/; $$UNTAR)
  356. if [[ $? -ne 0 ]]; then
  357. echo "Bundling lib files failed"
  358. exit 1
  359. fi
  360. echo bundle_native_lib "${bundle.snappy}" "snappy.lib" "snappy" "${snappy.lib}"
  361. bundle_native_lib "${bundle.snappy}" "snappy.lib" "snappy" "${snappy.lib}"
  362. echo bundle_native_lib "${bundle.openssl}" "openssl.lib" "crypto" "${openssl.lib}"
  363. bundle_native_lib "${bundle.openssl}" "openssl.lib" "crypto" "${openssl.lib}"
  364. fi
  365. BIN_DIR="${BUILD_DIR}/bin"
  366. if [[ -d $${BIN_DIR} ]] ; then
  367. TARGET_BIN_DIR="${BUILD_DIR}/${project.artifactId}-${project.version}/bin"
  368. mkdir -p $${TARGET_BIN_DIR}
  369. cd $${BIN_DIR}
  370. $$TAR * | (cd $${TARGET_BIN_DIR}/; $$UNTAR)
  371. if [[ $? -ne 0 ]]; then
  372. echo "Bundling bin files failed"
  373. exit 1
  374. fi
  375. if [[ "${bundle.snappy.in.bin}" == "true" ]]; then
  376. if [[ "${bundle.snappy}" == "true" ]]; then
  377. cd "${snappy.lib}"
  378. $$TAR *snappy* | (cd $${TARGET_BIN_DIR}/; $$UNTAR)
  379. if [[ $? -ne 0 ]]; then
  380. echo "Bundling snappy bin files failed"
  381. exit 1
  382. fi
  383. fi
  384. fi
  385. if [[ "${bundle.openssl.in.bin}" == "true" ]]; then
  386. if [[ "${bundle.openssl}" == "true" ]]; then
  387. cd "${openssl.lib}"
  388. $$TAR *crypto* | (cd $${TARGET_BIN_DIR}/; $$UNTAR)
  389. if [[ $? -ne 0 ]]; then
  390. echo "Bundling openssl bin files failed"
  391. exit 1
  392. fi
  393. fi
  394. fi
  395. fi
  396. </echo>
  397. <exec executable="${shell-executable}" dir="${project.build.directory}" failonerror="true">
  398. <arg line="./dist-copynativelibs.sh"/>
  399. </exec>
  400. </target>
  401. </configuration>
  402. </execution>
  403. <execution>
  404. <id>tar</id>
  405. <phase>package</phase>
  406. <goals>
  407. <goal>run</goal>
  408. </goals>
  409. <configuration>
  410. <target if="tar">
  411. <!-- Using Unix script to preserve symlinks -->
  412. <echo file="${project.build.directory}/dist-maketar.sh">
  413. cd "${project.build.directory}"
  414. tar cf - ${project.artifactId}-${project.version} | gzip > ${project.artifactId}-${project.version}.tar.gz
  415. </echo>
  416. <exec executable="${shell-executable}" dir="${project.build.directory}" failonerror="true">
  417. <arg line="./dist-maketar.sh"/>
  418. </exec>
  419. </target>
  420. </configuration>
  421. </execution>
  422. </executions>
  423. </plugin>
  424. <plugin>
  425. <groupId>org.apache.maven.plugins</groupId>
  426. <artifactId>maven-assembly-plugin</artifactId>
  427. <dependencies>
  428. <dependency>
  429. <groupId>org.apache.hadoop</groupId>
  430. <artifactId>hadoop-assemblies</artifactId>
  431. <version>${project.version}</version>
  432. </dependency>
  433. </dependencies>
  434. <executions>
  435. <execution>
  436. <id>dist</id>
  437. <phase>prepare-package</phase>
  438. <goals>
  439. <goal>single</goal>
  440. </goals>
  441. <configuration>
  442. <appendAssemblyId>false</appendAssemblyId>
  443. <attach>false</attach>
  444. <finalName>${project.artifactId}-${project.version}</finalName>
  445. <descriptorRefs>
  446. <descriptorRef>hadoop-dist</descriptorRef>
  447. </descriptorRefs>
  448. </configuration>
  449. </execution>
  450. </executions>
  451. </plugin>
  452. </plugins>
  453. </build>
  454. </profile>
  455. </profiles>
  456. </project>