pom.xml 19 KB

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