pom.xml 17 KB

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