pom.xml 17 KB

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