pom.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  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.
  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>3.0.0-SNAPSHOT</version>
  22. <relativePath>../../hadoop-project</relativePath>
  23. </parent>
  24. <groupId>org.apache.hadoop</groupId>
  25. <artifactId>hadoop-kms</artifactId>
  26. <version>3.0.0-SNAPSHOT</version>
  27. <packaging>war</packaging>
  28. <name>Apache Hadoop KMS</name>
  29. <description>Apache Hadoop KMS</description>
  30. <properties>
  31. <tomcat.version>6.0.36</tomcat.version>
  32. <kms.tomcat.dist.dir>
  33. ${project.build.directory}/${project.artifactId}-${project.version}/share/hadoop/kms/tomcat
  34. </kms.tomcat.dist.dir>
  35. <tomcat.download.url>
  36. http://archive.apache.org/dist/tomcat/tomcat-6/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.tar.gz
  37. </tomcat.download.url>
  38. </properties>
  39. <dependencies>
  40. <dependency>
  41. <groupId>org.apache.hadoop</groupId>
  42. <artifactId>hadoop-minikdc</artifactId>
  43. <scope>test</scope>
  44. </dependency>
  45. <dependency>
  46. <groupId>junit</groupId>
  47. <artifactId>junit</artifactId>
  48. <scope>test</scope>
  49. </dependency>
  50. <dependency>
  51. <groupId>org.mockito</groupId>
  52. <artifactId>mockito-all</artifactId>
  53. <scope>test</scope>
  54. </dependency>
  55. <dependency>
  56. <groupId>org.apache.hadoop</groupId>
  57. <artifactId>hadoop-auth</artifactId>
  58. <scope>compile</scope>
  59. </dependency>
  60. <dependency>
  61. <groupId>com.google.guava</groupId>
  62. <artifactId>guava</artifactId>
  63. <scope>compile</scope>
  64. </dependency>
  65. <dependency>
  66. <groupId>com.sun.jersey</groupId>
  67. <artifactId>jersey-core</artifactId>
  68. <scope>compile</scope>
  69. </dependency>
  70. <dependency>
  71. <groupId>com.sun.jersey</groupId>
  72. <artifactId>jersey-server</artifactId>
  73. <scope>compile</scope>
  74. </dependency>
  75. <dependency>
  76. <groupId>javax.servlet</groupId>
  77. <artifactId>servlet-api</artifactId>
  78. <scope>provided</scope>
  79. </dependency>
  80. <dependency>
  81. <groupId>org.mortbay.jetty</groupId>
  82. <artifactId>jetty</artifactId>
  83. <scope>test</scope>
  84. </dependency>
  85. <dependency>
  86. <groupId>org.apache.hadoop</groupId>
  87. <artifactId>hadoop-common</artifactId>
  88. <scope>compile</scope>
  89. <exclusions>
  90. <exclusion>
  91. <groupId>javax.xml.stream</groupId>
  92. <artifactId>stax-api</artifactId>
  93. </exclusion>
  94. <exclusion>
  95. <groupId>commons-httpclient</groupId>
  96. <artifactId>commons-httpclient</artifactId>
  97. </exclusion>
  98. <exclusion>
  99. <groupId>tomcat</groupId>
  100. <artifactId>jasper-compiler</artifactId>
  101. </exclusion>
  102. <exclusion>
  103. <groupId>tomcat</groupId>
  104. <artifactId>jasper-runtime</artifactId>
  105. </exclusion>
  106. <exclusion>
  107. <groupId>javax.servlet</groupId>
  108. <artifactId>servlet-api</artifactId>
  109. </exclusion>
  110. <exclusion>
  111. <groupId>javax.servlet</groupId>
  112. <artifactId>jsp-api</artifactId>
  113. </exclusion>
  114. <exclusion>
  115. <groupId>javax.servlet.jsp</groupId>
  116. <artifactId>jsp-api</artifactId>
  117. </exclusion>
  118. <exclusion>
  119. <groupId>org.mortbay.jetty</groupId>
  120. <artifactId>jetty</artifactId>
  121. </exclusion>
  122. <exclusion>
  123. <groupId>org.mortbay.jetty</groupId>
  124. <artifactId>jetty-util</artifactId>
  125. </exclusion>
  126. <exclusion>
  127. <groupId>org.mortbay.jetty</groupId>
  128. <artifactId>jsp-api-2.1</artifactId>
  129. </exclusion>
  130. <exclusion>
  131. <groupId>org.mortbay.jetty</groupId>
  132. <artifactId>servlet-api-2.5</artifactId>
  133. </exclusion>
  134. <exclusion>
  135. <groupId>net.java.dev.jets3t</groupId>
  136. <artifactId>jets3t</artifactId>
  137. </exclusion>
  138. <exclusion>
  139. <groupId>org.eclipse.jdt</groupId>
  140. <artifactId>core</artifactId>
  141. </exclusion>
  142. <exclusion>
  143. <groupId>commons-el</groupId>
  144. <artifactId>commons-el</artifactId>
  145. </exclusion>
  146. </exclusions>
  147. </dependency>
  148. <dependency>
  149. <groupId>org.apache.hadoop</groupId>
  150. <artifactId>hadoop-common</artifactId>
  151. <scope>test</scope>
  152. <type>test-jar</type>
  153. </dependency>
  154. <dependency>
  155. <groupId>log4j</groupId>
  156. <artifactId>log4j</artifactId>
  157. <scope>compile</scope>
  158. </dependency>
  159. <dependency>
  160. <groupId>org.slf4j</groupId>
  161. <artifactId>slf4j-api</artifactId>
  162. <scope>compile</scope>
  163. </dependency>
  164. <dependency>
  165. <groupId>org.slf4j</groupId>
  166. <artifactId>slf4j-log4j12</artifactId>
  167. <scope>runtime</scope>
  168. </dependency>
  169. <dependency>
  170. <groupId>org.slf4j</groupId>
  171. <artifactId>jul-to-slf4j</artifactId>
  172. <scope>compile</scope>
  173. </dependency>
  174. <dependency>
  175. <groupId>org.mortbay.jetty</groupId>
  176. <artifactId>jetty-util</artifactId>
  177. <scope>compile</scope>
  178. </dependency>
  179. <dependency>
  180. <groupId>com.codahale.metrics</groupId>
  181. <artifactId>metrics-core</artifactId>
  182. <scope>compile</scope>
  183. </dependency>
  184. </dependencies>
  185. <build>
  186. <plugins>
  187. <plugin>
  188. <groupId>org.apache.maven.plugins</groupId>
  189. <artifactId>maven-surefire-plugin</artifactId>
  190. <configuration>
  191. <forkMode>always</forkMode>
  192. <threadCount>1</threadCount>
  193. <forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
  194. <properties>
  195. <property>
  196. <name>listener</name>
  197. <value>org.apache.hadoop.test.TimedOutTestsListener</value>
  198. </property>
  199. </properties>
  200. <excludes>
  201. <exclude>**/${test.exclude}.java</exclude>
  202. <exclude>${test.exclude.pattern}</exclude>
  203. </excludes>
  204. </configuration>
  205. </plugin>
  206. <plugin>
  207. <groupId>org.apache.maven.plugins</groupId>
  208. <artifactId>maven-antrun-plugin</artifactId>
  209. <executions>
  210. <execution>
  211. <id>create-web-xmls</id>
  212. <phase>generate-test-resources</phase>
  213. <goals>
  214. <goal>run</goal>
  215. </goals>
  216. <configuration>
  217. <target>
  218. <mkdir dir="${project.build.directory}/test-classes/webapp"/>
  219. <copy todir="${project.build.directory}/test-classes/webapp">
  220. <fileset dir="${basedir}/src/main/webapp"/>
  221. </copy>
  222. </target>
  223. </configuration>
  224. </execution>
  225. </executions>
  226. </plugin>
  227. <plugin>
  228. <groupId>org.apache.maven.plugins</groupId>
  229. <artifactId>maven-war-plugin</artifactId>
  230. <executions>
  231. <execution>
  232. <id>default-war</id>
  233. <phase>package</phase>
  234. <goals>
  235. <goal>war</goal>
  236. </goals>
  237. <configuration>
  238. <warName>kms</warName>
  239. <webappDirectory>${project.build.directory}/kms
  240. </webappDirectory>
  241. </configuration>
  242. </execution>
  243. </executions>
  244. </plugin>
  245. <plugin>
  246. <groupId>org.codehaus.mojo</groupId>
  247. <artifactId>findbugs-maven-plugin</artifactId>
  248. <configuration>
  249. <excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml
  250. </excludeFilterFile>
  251. </configuration>
  252. </plugin>
  253. </plugins>
  254. </build>
  255. <profiles>
  256. <profile>
  257. <id>docs</id>
  258. <activation>
  259. <activeByDefault>false</activeByDefault>
  260. </activation>
  261. <build>
  262. <plugins>
  263. <plugin>
  264. <groupId>org.apache.maven.plugins</groupId>
  265. <artifactId>maven-site-plugin</artifactId>
  266. <executions>
  267. <execution>
  268. <id>docs</id>
  269. <phase>prepare-package</phase>
  270. <goals>
  271. <goal>site</goal>
  272. </goals>
  273. </execution>
  274. </executions>
  275. </plugin>
  276. </plugins>
  277. </build>
  278. </profile>
  279. <profile>
  280. <id>dist</id>
  281. <activation>
  282. <activeByDefault>false</activeByDefault>
  283. </activation>
  284. <build>
  285. <plugins>
  286. <plugin>
  287. <groupId>org.apache.maven.plugins</groupId>
  288. <artifactId>maven-assembly-plugin</artifactId>
  289. <dependencies>
  290. <dependency>
  291. <groupId>org.apache.hadoop</groupId>
  292. <artifactId>hadoop-assemblies</artifactId>
  293. <version>${project.version}</version>
  294. </dependency>
  295. </dependencies>
  296. <executions>
  297. <execution>
  298. <id>dist</id>
  299. <phase>package</phase>
  300. <goals>
  301. <goal>single</goal>
  302. </goals>
  303. <configuration>
  304. <finalName>${project.artifactId}-${project.version}
  305. </finalName>
  306. <appendAssemblyId>false</appendAssemblyId>
  307. <attach>false</attach>
  308. <descriptorRefs>
  309. <descriptorRef>hadoop-kms-dist</descriptorRef>
  310. </descriptorRefs>
  311. </configuration>
  312. </execution>
  313. </executions>
  314. </plugin>
  315. <!-- Downloading Tomcat TAR.GZ, using downloads/ dir to avoid downloading over an over -->
  316. <plugin>
  317. <groupId>org.apache.maven.plugins</groupId>
  318. <artifactId>maven-antrun-plugin</artifactId>
  319. <executions>
  320. <execution>
  321. <id>dist</id>
  322. <goals>
  323. <goal>run</goal>
  324. </goals>
  325. <phase>package</phase>
  326. <configuration>
  327. <target>
  328. <mkdir dir="downloads"/>
  329. <get
  330. src="${tomcat.download.url}"
  331. dest="downloads/apache-tomcat-${tomcat.version}.tar.gz"
  332. verbose="true" skipexisting="true"/>
  333. <delete dir="${project.build.directory}/tomcat.exp"/>
  334. <mkdir dir="${project.build.directory}/tomcat.exp"/>
  335. <!-- Using Unix script to preserve file permissions -->
  336. <echo file="${project.build.directory}/tomcat-untar.sh">
  337. cd "${project.build.directory}/tomcat.exp"
  338. gzip -cd ../../downloads/apache-tomcat-${tomcat.version}.tar.gz | tar xf -
  339. </echo>
  340. <exec executable="sh" dir="${project.build.directory}"
  341. failonerror="true">
  342. <arg line="./tomcat-untar.sh"/>
  343. </exec>
  344. <move
  345. file="${project.build.directory}/tomcat.exp/apache-tomcat-${tomcat.version}"
  346. tofile="${kms.tomcat.dist.dir}"/>
  347. <delete dir="${project.build.directory}/tomcat.exp"/>
  348. <delete dir="${kms.tomcat.dist.dir}/webapps"/>
  349. <mkdir dir="${kms.tomcat.dist.dir}/webapps"/>
  350. <delete file="${kms.tomcat.dist.dir}/conf/server.xml"/>
  351. <copy file="${basedir}/src/main/tomcat/server.xml"
  352. toDir="${kms.tomcat.dist.dir}/conf"/>
  353. <delete file="${kms.tomcat.dist.dir}/conf/ssl-server.xml"/>
  354. <copy file="${basedir}/src/main/tomcat/ssl-server.xml"
  355. toDir="${kms.tomcat.dist.dir}/conf"/>
  356. <delete
  357. file="${kms.tomcat.dist.dir}/conf/logging.properties"/>
  358. <copy file="${basedir}/src/main/tomcat/logging.properties"
  359. toDir="${kms.tomcat.dist.dir}/conf"/>
  360. <copy toDir="${kms.tomcat.dist.dir}/webapps/ROOT">
  361. <fileset dir="${basedir}/src/main/tomcat/ROOT"/>
  362. </copy>
  363. <copy toDir="${kms.tomcat.dist.dir}/webapps/kms">
  364. <fileset dir="${project.build.directory}/kms"/>
  365. </copy>
  366. </target>
  367. </configuration>
  368. </execution>
  369. <execution>
  370. <id>tar</id>
  371. <phase>package</phase>
  372. <goals>
  373. <goal>run</goal>
  374. </goals>
  375. <configuration>
  376. <target if="tar">
  377. <!-- Using Unix script to preserve symlinks -->
  378. <echo file="${project.build.directory}/dist-maketar.sh">
  379. cd "${project.build.directory}"
  380. tar cf - ${project.artifactId}-${project.version} | gzip > ${project.artifactId}-${project.version}.tar.gz
  381. </echo>
  382. <exec executable="sh" dir="${project.build.directory}"
  383. failonerror="true">
  384. <arg line="./dist-maketar.sh"/>
  385. </exec>
  386. </target>
  387. </configuration>
  388. </execution>
  389. </executions>
  390. </plugin>
  391. </plugins>
  392. </build>
  393. </profile>
  394. </profiles>
  395. </project>