pom.xml 17 KB

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