pom.xml 17 KB

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