pom.xml 14 KB

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