pom.xml 19 KB

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