pom.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  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. https://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.5.0-SNAPSHOT</version>
  22. <relativePath>../hadoop-project</relativePath>
  23. </parent>
  24. <artifactId>hadoop-project-dist</artifactId>
  25. <version>3.5.0-SNAPSHOT</version>
  26. <description>Apache Hadoop Project Dist POM</description>
  27. <name>Apache Hadoop Project Dist POM</name>
  28. <packaging>pom</packaging>
  29. <properties>
  30. <hadoop.tmp.dir>${project.build.directory}/test</hadoop.tmp.dir>
  31. <test.build.data>${project.build.directory}/test/data</test.build.data>
  32. <hadoop.log.dir>${project.build.directory}/log</hadoop.log.dir>
  33. <test.build.webapps>${project.build.directory}/test-classes/webapps</test.build.webapps>
  34. <test.cache.data>${project.build.directory}/test-classes</test.cache.data>
  35. <test.build.classes>${project.build.directory}/test-classes</test.build.classes>
  36. <hadoop.component>UNDEF</hadoop.component>
  37. <snappy.lib></snappy.lib>
  38. <bundle.snappy>false</bundle.snappy>
  39. <zstd.lib></zstd.lib>
  40. <bundle.zstd>false</bundle.zstd>
  41. <bundle.zstd.in.bin>false</bundle.zstd.in.bin>
  42. <isal.lib></isal.lib>
  43. <bundle.isal>false</bundle.isal>
  44. <openssl.lib></openssl.lib>
  45. <bundle.openssl>false</bundle.openssl>
  46. <bundle.openssl.in.bin>false</bundle.openssl.in.bin>
  47. </properties>
  48. <dependencies>
  49. <dependency>
  50. <groupId>org.apache.hadoop</groupId>
  51. <artifactId>hadoop-annotations</artifactId>
  52. <scope>provided</scope>
  53. </dependency>
  54. </dependencies>
  55. <build>
  56. <plugins>
  57. <plugin>
  58. <groupId>org.apache.maven.plugins</groupId>
  59. <artifactId>maven-jar-plugin</artifactId>
  60. <executions>
  61. <execution>
  62. <id>prepare-jar</id>
  63. <phase>prepare-package</phase>
  64. <goals>
  65. <goal>jar</goal>
  66. </goals>
  67. </execution>
  68. <execution>
  69. <id>prepare-test-jar</id>
  70. <phase>prepare-package</phase>
  71. <goals>
  72. <goal>test-jar</goal>
  73. </goals>
  74. <configuration>
  75. <includes>
  76. <include>**/*.class</include>
  77. <include>webapps/**</include>
  78. <include>META-INF/LICENSE.txt</include>
  79. <include>META-INF/NOTICE.txt</include>
  80. </includes>
  81. </configuration>
  82. </execution>
  83. </executions>
  84. </plugin>
  85. <plugin>
  86. <groupId>com.github.spotbugs</groupId>
  87. <artifactId>spotbugs-maven-plugin</artifactId>
  88. <configuration>
  89. <excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
  90. <maxHeap>2048</maxHeap>
  91. </configuration>
  92. </plugin>
  93. <plugin>
  94. <groupId>org.apache.maven.plugins</groupId>
  95. <artifactId>maven-javadoc-plugin</artifactId>
  96. <configuration>
  97. <maxmemory>768m</maxmemory>
  98. <quiet>true</quiet>
  99. <verbose>false</verbose>
  100. <source>${maven.compile.source}</source>
  101. <charset>${maven.compile.encoding}</charset>
  102. <reportOutputDirectory>${project.build.directory}/site</reportOutputDirectory>
  103. <destDir>${destDirPath}</destDir>
  104. <groups>
  105. <group>
  106. <title>${project.name} API</title>
  107. <packages>org.apache.hadoop*</packages>
  108. </group>
  109. </groups>
  110. <!-- switch on dependency-driven aggregation -->
  111. <includeDependencySources>false</includeDependencySources>
  112. <dependencySourceIncludes>
  113. <!-- include ONLY dependencies I control -->
  114. <dependencySourceInclude>org.apache.hadoop:hadoop-annotations</dependencySourceInclude>
  115. </dependencySourceIncludes>
  116. </configuration>
  117. </plugin>
  118. </plugins>
  119. </build>
  120. <profiles>
  121. <profile>
  122. <id>docs</id>
  123. <activation>
  124. <activeByDefault>false</activeByDefault>
  125. </activation>
  126. <properties>
  127. <jdiff.stable.api>3.4.0</jdiff.stable.api>
  128. <jdiff.stability>-unstable</jdiff.stability>
  129. <!-- Commented out for HADOOP-11776 -->
  130. <!-- Uncomment param name="${jdiff.compatibility}" in javadoc doclet if compatibility is not empty -->
  131. <jdiff.compatibility></jdiff.compatibility>
  132. <jdiff.javadoc.maxmemory>512m</jdiff.javadoc.maxmemory>
  133. </properties>
  134. <dependencies>
  135. <dependency>
  136. <groupId>xerces</groupId>
  137. <artifactId>xercesImpl</artifactId>
  138. <version>${xerces.jdiff.version}</version>
  139. </dependency>
  140. </dependencies>
  141. <build>
  142. <plugins>
  143. <plugin>
  144. <groupId>org.apache.maven.plugins</groupId>
  145. <artifactId>maven-javadoc-plugin</artifactId>
  146. <executions>
  147. <execution>
  148. <goals>
  149. <goal>javadoc-no-fork</goal>
  150. </goals>
  151. <phase>prepare-package</phase>
  152. </execution>
  153. </executions>
  154. </plugin>
  155. <plugin>
  156. <groupId>org.apache.maven.plugins</groupId>
  157. <artifactId>maven-dependency-plugin</artifactId>
  158. <executions>
  159. <execution>
  160. <id>site</id>
  161. <phase>prepare-package</phase>
  162. <goals>
  163. <goal>copy</goal>
  164. </goals>
  165. <configuration>
  166. <artifactItems>
  167. <artifactItem>
  168. <groupId>jdiff</groupId>
  169. <artifactId>jdiff</artifactId>
  170. <version>${jdiff.version}</version>
  171. <overWrite>false</overWrite>
  172. <outputDirectory>${project.build.directory}</outputDirectory>
  173. <destFileName>jdiff.jar</destFileName>
  174. </artifactItem>
  175. <artifactItem>
  176. <groupId>org.apache.hadoop</groupId>
  177. <artifactId>hadoop-annotations</artifactId>
  178. <version>${project.version}</version>
  179. <overWrite>false</overWrite>
  180. <outputDirectory>${project.build.directory}</outputDirectory>
  181. <destFileName>hadoop-annotations.jar</destFileName>
  182. </artifactItem>
  183. <artifactItem>
  184. <groupId>xerces</groupId>
  185. <artifactId>xercesImpl</artifactId>
  186. <version>${xerces.jdiff.version}</version>
  187. <overWrite>false</overWrite>
  188. <outputDirectory>${project.build.directory}</outputDirectory>
  189. <destFileName>xerces.jar</destFileName>
  190. </artifactItem>
  191. </artifactItems>
  192. </configuration>
  193. </execution>
  194. </executions>
  195. </plugin>
  196. <plugin>
  197. <groupId>org.apache.maven.plugins</groupId>
  198. <artifactId>maven-antrun-plugin</artifactId>
  199. <executions>
  200. <execution>
  201. <id>choose-javadoc-dest-dir</id>
  202. <phase>validate</phase>
  203. <goals>
  204. <goal>run</goal>
  205. </goals>
  206. <configuration>
  207. <exportAntProperties>true</exportAntProperties>
  208. <target>
  209. <!-- destDirPath is where the generated Javadocs will be located.
  210. The value of destDirPath obtained below is used for the "destDir" attribute
  211. in the maven-javadoc-plugin in this pom.xml.
  212. As per HADOOP-8500 and HADOOP-13784, we wanted to dump the javadoc into an
  213. "api" directory that was outside the "site" directory.
  214. Unfortunately, maven-javadoc-plugin doesn't give us a way to do that since
  215. "destDir" is always appended to "reportOutputDirectory". While we can achieve
  216. this using the relative path "../api", it only works for Windows. But it fails
  217. on Linux since the parent directory of "../api" wouldn't yet exist and the
  218. path resolution fails.
  219. Thus, we're going to leverage this approach for Windows and leave the
  220. behaviour on Linux intact.-->
  221. <condition property="destDirPath" value="../api" else="${project.build.directory}/api">
  222. <and>
  223. <os family="windows"/>
  224. </and>
  225. </condition>
  226. <echo>destDirPath to use for maven-javadoc-plugin = ${destDirPath}</echo>
  227. </target>
  228. </configuration>
  229. </execution>
  230. <!-- Pre site -->
  231. <execution>
  232. <id>pre-site</id>
  233. <phase>prepare-package</phase>
  234. <goals>
  235. <goal>run</goal>
  236. </goals>
  237. <configuration>
  238. <target if="is.hadoop.common.component">
  239. <!-- HADOOP-13428: This is for workaround issues of JDiff
  240. - https://sourceforge.net/p/javadiff/bugs/19/ -->
  241. <exec executable="patch" input="dev-support/jdiff-workaround.patch" dir="${basedir}">
  242. <arg value="-p3"/>
  243. </exec>
  244. </target>
  245. </configuration>
  246. </execution>
  247. <execution>
  248. <id>site</id>
  249. <phase>prepare-package</phase>
  250. <goals>
  251. <goal>run</goal>
  252. </goals>
  253. <configuration>
  254. <target if="is.hadoop.component">
  255. <mkdir dir="${project.build.directory}/docs-src"/>
  256. <!-- Docs -->
  257. <style basedir="${basedir}/src/main/resources"
  258. destdir="${project.build.directory}/site"
  259. includes="core-default.xml"
  260. style="${basedir}/src/main/xsl/configuration.xsl"/>
  261. <!-- Jdiff -->
  262. <mkdir dir="${project.build.directory}/site/jdiff/xml"/>
  263. <javadoc maxmemory="${jdiff.javadoc.maxmemory}" verbose="yes">
  264. <doclet name="org.apache.hadoop.classification.tools.IncludePublicAnnotationsJDiffDoclet"
  265. path="${project.build.directory}/hadoop-annotations.jar:${project.build.directory}/jdiff.jar">
  266. <param name="-apidir" value="${project.build.directory}/site/jdiff/xml"/>
  267. <param name="-apiname" value="${project.name} ${project.version}"/>
  268. <param name="${jdiff.stability}"/>
  269. </doclet>
  270. <packageset dir="${basedir}/src/main/java"/>
  271. <classpath>
  272. <path refid="maven.compile.classpath"/>
  273. </classpath>
  274. </javadoc>
  275. <javadoc sourcepath="${basedir}/src/main/java"
  276. destdir="${project.build.directory}/site/jdiff/xml"
  277. sourceFiles="${basedir}/dev-support/jdiff/Null.java"
  278. maxmemory="${jdiff.javadoc.maxmemory}">
  279. <doclet name="org.apache.hadoop.classification.tools.IncludePublicAnnotationsJDiffDoclet"
  280. path="${project.build.directory}/hadoop-annotations.jar:${project.build.directory}/jdiff.jar:${project.build.directory}/xerces.jar">
  281. <param name="-oldapi" value="${project.name} ${jdiff.stable.api}"/>
  282. <param name="-newapi" value="${project.name} ${project.version}"/>
  283. <param name="-oldapidir" value="${basedir}/dev-support/jdiff"/>
  284. <param name="-newapidir" value="${project.build.directory}/site/jdiff/xml"/>
  285. <param name="-javadocold"
  286. value="https://hadoop.apache.org/docs/r${jdiff.stable.api}/api/"/>
  287. <param name="-javadocnew" value="${project.build.directory}/site/api"/>
  288. <param name="-stats"/>
  289. <param name="${jdiff.stability}"/>
  290. <!--param name="${jdiff.compatibility}"/-->
  291. </doclet>
  292. <classpath>
  293. <path refid="maven.compile.classpath"/>
  294. </classpath>
  295. </javadoc>
  296. </target>
  297. </configuration>
  298. </execution>
  299. <!-- post site phase -->
  300. <execution>
  301. <id>post-site</id>
  302. <phase>prepare-package</phase>
  303. <goals>
  304. <goal>run</goal>
  305. </goals>
  306. <configuration>
  307. <target if="is.hadoop.common.component">
  308. <!-- HADOOP-13428: Revert temporary patch-->
  309. <exec executable="patch" input="dev-support/jdiff-workaround.patch" dir="${basedir}">
  310. <arg value="-p3"/>
  311. <arg value="-R"/>
  312. </exec>
  313. </target>
  314. </configuration>
  315. </execution>
  316. </executions>
  317. </plugin>
  318. </plugins>
  319. </build>
  320. </profile>
  321. <profile>
  322. <id>dist</id>
  323. <activation>
  324. <activeByDefault>false</activeByDefault>
  325. </activation>
  326. <build>
  327. <plugins>
  328. <plugin>
  329. <groupId>org.codehaus.mojo</groupId>
  330. <artifactId>exec-maven-plugin</artifactId>
  331. <version>${exec-maven-plugin.version}</version>
  332. <executions>
  333. <execution>
  334. <id>pre-dist</id>
  335. <phase>prepare-package</phase>
  336. <goals>
  337. <goal>exec</goal>
  338. </goals>
  339. <configuration>
  340. <executable>${shell-executable}</executable>
  341. <workingDirectory>${project.build.directory}</workingDirectory>
  342. <arguments>
  343. <argument>${project.parent.basedir}/../dev-support/bin/dist-copynativelibs</argument>
  344. <argument>--version=${project.version}</argument>
  345. <argument>--builddir=${project.build.directory}</argument>
  346. <argument>--artifactid=${project.artifactId}</argument>
  347. <argument>--isalbundle=${bundle.isal}</argument>
  348. <argument>--isallib=${isal.lib}</argument>
  349. <argument>--openssllib=${openssl.lib}</argument>
  350. <argument>--opensslbinbundle=${bundle.openssl.in.bin}</argument>
  351. <argument>--openssllibbundle=${bundle.openssl}</argument>
  352. <argument>--snappylib=${snappy.lib}</argument>
  353. <argument>--snappylibbundle=${bundle.snappy}</argument>
  354. <argument>--zstdbinbundle=${bundle.zstd.in.bin}</argument>
  355. <argument>--zstdlib=${zstd.lib}</argument>
  356. <argument>--zstdlibbundle=${bundle.zstd}</argument>
  357. </arguments>
  358. </configuration>
  359. </execution>
  360. </executions>
  361. </plugin>
  362. <plugin>
  363. <groupId>org.apache.maven.plugins</groupId>
  364. <artifactId>maven-antrun-plugin</artifactId>
  365. <executions>
  366. <execution>
  367. <id>tar</id>
  368. <phase>package</phase>
  369. <goals>
  370. <goal>run</goal>
  371. </goals>
  372. <configuration>
  373. <target if="tar">
  374. <!-- Using Unix script to preserve symlinks -->
  375. <echo file="${project.build.directory}/dist-maketar.sh">
  376. cd "${project.build.directory}"
  377. tar cf - ${project.artifactId}-${project.version} | gzip > ${project.artifactId}-${project.version}.tar.gz
  378. </echo>
  379. <exec executable="${shell-executable}" dir="${project.build.directory}" failonerror="true">
  380. <arg line="./dist-maketar.sh"/>
  381. </exec>
  382. </target>
  383. </configuration>
  384. </execution>
  385. </executions>
  386. </plugin>
  387. <plugin>
  388. <groupId>org.apache.maven.plugins</groupId>
  389. <artifactId>maven-assembly-plugin</artifactId>
  390. <dependencies>
  391. <dependency>
  392. <groupId>org.apache.hadoop</groupId>
  393. <artifactId>hadoop-assemblies</artifactId>
  394. <version>${hadoop.version}</version>
  395. </dependency>
  396. </dependencies>
  397. <executions>
  398. <execution>
  399. <id>dist</id>
  400. <phase>package</phase>
  401. <goals>
  402. <goal>single</goal>
  403. </goals>
  404. <configuration>
  405. <appendAssemblyId>false</appendAssemblyId>
  406. <attach>false</attach>
  407. <finalName>${project.artifactId}-${project.version}</finalName>
  408. <descriptorRefs>
  409. <descriptorRef>hadoop-dist</descriptorRef>
  410. </descriptorRefs>
  411. </configuration>
  412. </execution>
  413. </executions>
  414. </plugin>
  415. </plugins>
  416. </build>
  417. </profile>
  418. <profile>
  419. <id>doclet</id>
  420. <activation>
  421. <jdk>(,10)</jdk>
  422. </activation>
  423. <build>
  424. <plugins>
  425. <plugin>
  426. <groupId>org.apache.maven.plugins</groupId>
  427. <artifactId>maven-javadoc-plugin</artifactId>
  428. <configuration>
  429. <doclet>org.apache.hadoop.classification.tools.ExcludePrivateAnnotationsStandardDoclet</doclet>
  430. <docletArtifacts>
  431. <docletArtifact>
  432. <groupId>org.apache.hadoop</groupId>
  433. <artifactId>hadoop-annotations</artifactId>
  434. <version>${hadoop.version}</version>
  435. </docletArtifact>
  436. </docletArtifacts>
  437. <useStandardDocletOptions>true</useStandardDocletOptions>
  438. </configuration>
  439. </plugin>
  440. </plugins>
  441. </build>
  442. </profile>
  443. </profiles>
  444. </project>