pom.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  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.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-checkstyle-plugin</artifactId>
  106. <configuration>
  107. <configLocation>file://${basedir}/dev-support/checkstyle.xml</configLocation>
  108. <failOnViolation>false</failOnViolation>
  109. <format>xml</format>
  110. <format>html</format>
  111. <outputFile>${project.build.directory}/test/checkstyle-errors.xml</outputFile>
  112. </configuration>
  113. </plugin>
  114. <plugin>
  115. <groupId>org.apache.maven.plugins</groupId>
  116. <artifactId>maven-javadoc-plugin</artifactId>
  117. <configuration>
  118. <linksource>true</linksource>
  119. <maxmemory>512m</maxmemory>
  120. <quiet>true</quiet>
  121. <verbose>false</verbose>
  122. <source>${maven.compile.source}</source>
  123. <charset>${maven.compile.encoding}</charset>
  124. <reportOutputDirectory>${project.build.directory}/site</reportOutputDirectory>
  125. <destDir>api</destDir>
  126. <groups>
  127. <group>
  128. <title>${project.name} API</title>
  129. <packages>org.apache.hadoop*</packages>
  130. </group>
  131. </groups>
  132. <doclet>org.apache.hadoop.classification.tools.ExcludePrivateAnnotationsStandardDoclet</doclet>
  133. <docletArtifacts>
  134. <docletArtifact>
  135. <groupId>org.apache.hadoop</groupId>
  136. <artifactId>hadoop-annotations</artifactId>
  137. <version>${project.version}</version>
  138. </docletArtifact>
  139. </docletArtifacts>
  140. <useStandardDocletOptions>true</useStandardDocletOptions>
  141. <!-- switch on dependency-driven aggregation -->
  142. <includeDependencySources>false</includeDependencySources>
  143. <dependencySourceIncludes>
  144. <!-- include ONLY dependencies I control -->
  145. <dependencySourceInclude>org.apache.hadoop:hadoop-annotations</dependencySourceInclude>
  146. </dependencySourceIncludes>
  147. </configuration>
  148. </plugin>
  149. </plugins>
  150. </build>
  151. <profiles>
  152. <profile>
  153. <id>docs</id>
  154. <activation>
  155. <activeByDefault>false</activeByDefault>
  156. </activation>
  157. <properties>
  158. <jdiff.stable.api>0.20.2</jdiff.stable.api>
  159. <jdiff.stability>-unstable</jdiff.stability>
  160. <jdiff.compatibility></jdiff.compatibility>
  161. <jdiff.javadoc.maxmemory>512m</jdiff.javadoc.maxmemory>
  162. </properties>
  163. <build>
  164. <plugins>
  165. <plugin>
  166. <groupId>org.apache.maven.plugins</groupId>
  167. <artifactId>maven-javadoc-plugin</artifactId>
  168. <executions>
  169. <execution>
  170. <goals>
  171. <goal>javadoc</goal>
  172. </goals>
  173. <phase>prepare-package</phase>
  174. </execution>
  175. </executions>
  176. </plugin>
  177. <plugin>
  178. <groupId>org.codehaus.mojo</groupId>
  179. <artifactId>findbugs-maven-plugin</artifactId>
  180. <executions>
  181. <execution>
  182. <goals>
  183. <goal>findbugs</goal>
  184. </goals>
  185. <phase>prepare-package</phase>
  186. </execution>
  187. </executions>
  188. <configuration>
  189. <excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
  190. </configuration>
  191. </plugin>
  192. <plugin>
  193. <groupId>org.apache.maven.plugins</groupId>
  194. <artifactId>maven-dependency-plugin</artifactId>
  195. <executions>
  196. <execution>
  197. <id>site</id>
  198. <phase>prepare-package</phase>
  199. <goals>
  200. <goal>copy</goal>
  201. </goals>
  202. <configuration>
  203. <artifactItems>
  204. <artifactItem>
  205. <groupId>jdiff</groupId>
  206. <artifactId>jdiff</artifactId>
  207. <version>${jdiff.version}</version>
  208. <overWrite>false</overWrite>
  209. <outputDirectory>${project.build.directory}</outputDirectory>
  210. <destFileName>jdiff.jar</destFileName>
  211. </artifactItem>
  212. <artifactItem>
  213. <groupId>org.apache.hadoop</groupId>
  214. <artifactId>hadoop-annotations</artifactId>
  215. <version>${project.version}</version>
  216. <overWrite>false</overWrite>
  217. <outputDirectory>${project.build.directory}</outputDirectory>
  218. <destFileName>hadoop-annotations.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. <copy todir="${project.build.directory}/docs-src">
  239. <fileset dir="${basedir}/src/main/docs"/>
  240. </copy>
  241. <!-- Docs -->
  242. <copy file="${project.build.directory}/docs-src/releasenotes.html"
  243. todir="${project.build.directory}/site"/>
  244. <style basedir="${basedir}/src/main/resources"
  245. destdir="${project.build.directory}/site"
  246. includes="core-default.xml"
  247. style="${basedir}/src/main/xsl/configuration.xsl"/>
  248. <!-- Convert 'CHANGES.txt' to 'changes.html" -->
  249. <exec executable="perl" input="${basedir}/../CHANGES.txt"
  250. output="${project.build.directory}/site/changes.html"
  251. failonerror="true">
  252. <arg value="${project.build.directory}/docs-src/changes/changes2html.pl"/>
  253. </exec>
  254. <copy todir="${project.build.directory}/site">
  255. <fileset dir="${project.build.directory}/docs-src/changes" includes="*.css"/>
  256. </copy>
  257. <!-- Jdiff -->
  258. <mkdir dir="${project.build.directory}/site/jdiff/xml"/>
  259. <javadoc maxmemory="${jdiff.javadoc.maxmemory}" verbose="yes">
  260. <doclet name="org.apache.hadoop.classification.tools.ExcludePrivateAnnotationsJDiffDoclet"
  261. path="${project.build.directory}/hadoop-annotations.jar:${project.build.directory}/jdiff.jar">
  262. <param name="-apidir" value="${project.build.directory}/site/jdiff/xml"/>
  263. <param name="-apiname" value="hadoop-core ${project.version}"/>
  264. <param name="${jdiff.stability}"/>
  265. </doclet>
  266. <packageset dir="${basedir}/src/main/java"/>
  267. <classpath>
  268. <path refid="maven.compile.classpath"/>
  269. </classpath>
  270. </javadoc>
  271. <javadoc sourcepath="${basedir}/src/main/java"
  272. destdir="${project.build.directory}/site/jdiff/xml"
  273. sourceFiles="${basedir}/dev-support/jdiff/Null.java"
  274. maxmemory="${jdiff.javadoc.maxmemory}">
  275. <doclet name="org.apache.hadoop.classification.tools.ExcludePrivateAnnotationsJDiffDoclet"
  276. path="${project.build.directory}/hadoop-annotations.jar:${project.build.directory}/jdiff.jar">
  277. <param name="-oldapi" value="hadoop-core ${jdiff.stable.api}"/>
  278. <param name="-newapi" value="hadoop-core ${project.version}"/>
  279. <param name="-oldapidir" value="${basedir}/dev-support/jdiff"/>
  280. <param name="-newapidir" value="${project.build.directory}/site/jdiff/xml"/>
  281. <param name="-javadocold"
  282. value="http://hadoop.apache.org/docs/${jdiff.stable.api}/api/"/>
  283. <param name="-javadocnew" value="${project.build.directory}/site/api"/>
  284. <param name="-stats"/>
  285. <param name="${jdiff.stability}"/>
  286. <param name="${jdiff.compatibility}"/>
  287. </doclet>
  288. <classpath>
  289. <path refid="maven.compile.classpath"/>
  290. </classpath>
  291. </javadoc>
  292. <xslt style="${env.FINDBUGS_HOME}/src/xsl/default.xsl"
  293. in="${project.build.directory}/findbugsXml.xml"
  294. out="${project.build.directory}/site/findbugs.html"/>
  295. </target>
  296. </configuration>
  297. </execution>
  298. </executions>
  299. </plugin>
  300. </plugins>
  301. </build>
  302. </profile>
  303. <profile>
  304. <id>dist</id>
  305. <activation>
  306. <activeByDefault>false</activeByDefault>
  307. </activation>
  308. <build>
  309. <plugins>
  310. <plugin>
  311. <groupId>org.apache.maven.plugins</groupId>
  312. <artifactId>maven-antrun-plugin</artifactId>
  313. <executions>
  314. <execution>
  315. <id>pre-dist</id>
  316. <phase>prepare-package</phase>
  317. <goals>
  318. <goal>run</goal>
  319. </goals>
  320. <configuration>
  321. <target>
  322. <!-- Using Unix script to preserve symlinks -->
  323. <echo file="${project.build.directory}/dist-copynativelibs.sh">
  324. BUILD_DIR="${project.build.directory}"
  325. TAR='tar cf -'
  326. UNTAR='tar xfBp -'
  327. LIB_DIR="${BUILD_DIR}/native/target/usr/local/lib"
  328. if [ -d $${LIB_DIR} ] ; then
  329. TARGET_DIR="${BUILD_DIR}/${project.artifactId}-${project.version}/lib/native"
  330. mkdir -p $${TARGET_DIR}
  331. cd $${LIB_DIR}
  332. $$TAR lib* | (cd $${TARGET_DIR}/; $$UNTAR)
  333. if [ "${bundle.snappy}" = "true" ] ; then
  334. cd "${snappy.lib}"
  335. $$TAR *snappy* | (cd $${TARGET_DIR}/; $$UNTAR)
  336. fi
  337. if [ "${bundle.openssl}" = "true" ] ; then
  338. cd "${openssl.lib}"
  339. $$TAR *crypto* | (cd $${TARGET_DIR}/; $$UNTAR)
  340. fi
  341. fi
  342. BIN_DIR="${BUILD_DIR}/bin"
  343. if [ -d $${BIN_DIR} ] ; then
  344. TARGET_BIN_DIR="${BUILD_DIR}/${project.artifactId}-${project.version}/bin"
  345. mkdir -p $${TARGET_BIN_DIR}
  346. cd $${BIN_DIR}
  347. $$TAR * | (cd $${TARGET_BIN_DIR}/; $$UNTAR)
  348. if [ "${bundle.snappy.in.bin}" = "true" ] ; then
  349. if [ "${bundle.snappy}" = "true" ] ; then
  350. cd "${snappy.lib}"
  351. $$TAR *snappy* | (cd $${TARGET_BIN_DIR}/; $$UNTAR)
  352. fi
  353. fi
  354. if [ "${bundle.openssl.in.bin}" = "true" ] ; then
  355. if [ "${bundle.openssl}" = "true" ] ; then
  356. cd "${openssl.lib}"
  357. $$TAR *crypto* | (cd $${TARGET_BIN_DIR}/; $$UNTAR)
  358. fi
  359. fi
  360. fi
  361. </echo>
  362. <exec executable="sh" dir="${project.build.directory}" failonerror="true">
  363. <arg line="./dist-copynativelibs.sh"/>
  364. </exec>
  365. </target>
  366. </configuration>
  367. </execution>
  368. <execution>
  369. <id>tar</id>
  370. <phase>package</phase>
  371. <goals>
  372. <goal>run</goal>
  373. </goals>
  374. <configuration>
  375. <target if="tar">
  376. <!-- Using Unix script to preserve symlinks -->
  377. <echo file="${project.build.directory}/dist-maketar.sh">
  378. cd "${project.build.directory}"
  379. tar cf - ${project.artifactId}-${project.version} | gzip > ${project.artifactId}-${project.version}.tar.gz
  380. </echo>
  381. <exec executable="sh" dir="${project.build.directory}" failonerror="true">
  382. <arg line="./dist-maketar.sh"/>
  383. </exec>
  384. </target>
  385. </configuration>
  386. </execution>
  387. </executions>
  388. </plugin>
  389. <plugin>
  390. <groupId>org.apache.maven.plugins</groupId>
  391. <artifactId>maven-assembly-plugin</artifactId>
  392. <dependencies>
  393. <dependency>
  394. <groupId>org.apache.hadoop</groupId>
  395. <artifactId>hadoop-assemblies</artifactId>
  396. <version>${project.version}</version>
  397. </dependency>
  398. </dependencies>
  399. <executions>
  400. <execution>
  401. <id>dist</id>
  402. <phase>prepare-package</phase>
  403. <goals>
  404. <goal>single</goal>
  405. </goals>
  406. <configuration>
  407. <appendAssemblyId>false</appendAssemblyId>
  408. <attach>false</attach>
  409. <finalName>${project.artifactId}-${project.version}</finalName>
  410. <descriptorRefs>
  411. <descriptorRef>hadoop-dist</descriptorRef>
  412. </descriptorRefs>
  413. </configuration>
  414. </execution>
  415. </executions>
  416. </plugin>
  417. </plugins>
  418. </build>
  419. </profile>
  420. </profiles>
  421. </project>