pom.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  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>2.6.0-SNAPSHOT</version>
  22. <relativePath>../../hadoop-project</relativePath>
  23. </parent>
  24. <groupId>org.apache.hadoop</groupId>
  25. <artifactId>hadoop-kms</artifactId>
  26. <version>2.6.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. <dependency>
  184. <groupId>org.apache.curator</groupId>
  185. <artifactId>curator-test</artifactId>
  186. <scope>test</scope>
  187. </dependency>
  188. </dependencies>
  189. <build>
  190. <plugins>
  191. <plugin>
  192. <groupId>org.apache.maven.plugins</groupId>
  193. <artifactId>maven-surefire-plugin</artifactId>
  194. <configuration>
  195. <forkMode>always</forkMode>
  196. <threadCount>1</threadCount>
  197. <forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
  198. <properties>
  199. <property>
  200. <name>listener</name>
  201. <value>org.apache.hadoop.test.TimedOutTestsListener</value>
  202. </property>
  203. </properties>
  204. <excludes>
  205. <exclude>**/${test.exclude}.java</exclude>
  206. <exclude>${test.exclude.pattern}</exclude>
  207. </excludes>
  208. </configuration>
  209. </plugin>
  210. <plugin>
  211. <groupId>org.apache.maven.plugins</groupId>
  212. <artifactId>maven-antrun-plugin</artifactId>
  213. <executions>
  214. <execution>
  215. <id>create-web-xmls</id>
  216. <phase>generate-test-resources</phase>
  217. <goals>
  218. <goal>run</goal>
  219. </goals>
  220. <configuration>
  221. <target>
  222. <mkdir dir="${project.build.directory}/test-classes/kms-webapp"/>
  223. <copy todir="${project.build.directory}/test-classes/kms-webapp">
  224. <fileset dir="${basedir}/src/main/webapp"/>
  225. </copy>
  226. </target>
  227. </configuration>
  228. </execution>
  229. </executions>
  230. </plugin>
  231. <plugin>
  232. <groupId>org.apache.maven.plugins</groupId>
  233. <artifactId>maven-war-plugin</artifactId>
  234. <executions>
  235. <execution>
  236. <id>default-war</id>
  237. <phase>prepare-package</phase>
  238. <goals>
  239. <goal>war</goal>
  240. </goals>
  241. <configuration>
  242. <archiveClasses>true</archiveClasses>
  243. <warName>kms</warName>
  244. <webappDirectory>${project.build.directory}/kms
  245. </webappDirectory>
  246. </configuration>
  247. </execution>
  248. </executions>
  249. </plugin>
  250. <plugin>
  251. <groupId>org.apache.maven.plugins</groupId>
  252. <artifactId>maven-jar-plugin</artifactId>
  253. <executions>
  254. <execution>
  255. <id>prepare-jar</id>
  256. <phase>prepare-package</phase>
  257. <goals>
  258. <goal>jar</goal>
  259. </goals>
  260. <configuration>
  261. <classifier>classes</classifier>
  262. </configuration>
  263. </execution>
  264. <execution>
  265. <id>prepare-test-jar</id>
  266. <phase>prepare-package</phase>
  267. <goals>
  268. <goal>test-jar</goal>
  269. </goals>
  270. </execution>
  271. </executions>
  272. </plugin>
  273. <plugin>
  274. <groupId>org.codehaus.mojo</groupId>
  275. <artifactId>findbugs-maven-plugin</artifactId>
  276. <configuration>
  277. <excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml
  278. </excludeFilterFile>
  279. </configuration>
  280. </plugin>
  281. </plugins>
  282. </build>
  283. <profiles>
  284. <profile>
  285. <id>docs</id>
  286. <activation>
  287. <activeByDefault>false</activeByDefault>
  288. </activation>
  289. <build>
  290. <plugins>
  291. <plugin>
  292. <groupId>org.apache.maven.plugins</groupId>
  293. <artifactId>maven-site-plugin</artifactId>
  294. <executions>
  295. <execution>
  296. <id>docs</id>
  297. <phase>prepare-package</phase>
  298. <goals>
  299. <goal>site</goal>
  300. </goals>
  301. </execution>
  302. </executions>
  303. </plugin>
  304. </plugins>
  305. </build>
  306. </profile>
  307. <profile>
  308. <id>dist</id>
  309. <activation>
  310. <activeByDefault>false</activeByDefault>
  311. </activation>
  312. <build>
  313. <plugins>
  314. <plugin>
  315. <groupId>org.apache.maven.plugins</groupId>
  316. <artifactId>maven-assembly-plugin</artifactId>
  317. <dependencies>
  318. <dependency>
  319. <groupId>org.apache.hadoop</groupId>
  320. <artifactId>hadoop-assemblies</artifactId>
  321. <version>${project.version}</version>
  322. </dependency>
  323. </dependencies>
  324. <executions>
  325. <execution>
  326. <id>dist</id>
  327. <phase>package</phase>
  328. <goals>
  329. <goal>single</goal>
  330. </goals>
  331. <configuration>
  332. <finalName>${project.artifactId}-${project.version}
  333. </finalName>
  334. <appendAssemblyId>false</appendAssemblyId>
  335. <attach>false</attach>
  336. <descriptorRefs>
  337. <descriptorRef>hadoop-kms-dist</descriptorRef>
  338. </descriptorRefs>
  339. </configuration>
  340. </execution>
  341. </executions>
  342. </plugin>
  343. <!-- Downloading Tomcat TAR.GZ, using downloads/ dir to avoid downloading over an over -->
  344. <plugin>
  345. <groupId>org.apache.maven.plugins</groupId>
  346. <artifactId>maven-antrun-plugin</artifactId>
  347. <executions>
  348. <execution>
  349. <id>dist</id>
  350. <goals>
  351. <goal>run</goal>
  352. </goals>
  353. <phase>package</phase>
  354. <configuration>
  355. <target>
  356. <mkdir dir="downloads"/>
  357. <get
  358. src="${tomcat.download.url}"
  359. dest="downloads/apache-tomcat-${tomcat.version}.tar.gz"
  360. verbose="true" skipexisting="true"/>
  361. <delete dir="${project.build.directory}/tomcat.exp"/>
  362. <mkdir dir="${project.build.directory}/tomcat.exp"/>
  363. <!-- Using Unix script to preserve file permissions -->
  364. <echo file="${project.build.directory}/tomcat-untar.sh">
  365. cd "${project.build.directory}/tomcat.exp"
  366. gzip -cd ../../downloads/apache-tomcat-${tomcat.version}.tar.gz | tar xf -
  367. </echo>
  368. <exec executable="sh" dir="${project.build.directory}"
  369. failonerror="true">
  370. <arg line="./tomcat-untar.sh"/>
  371. </exec>
  372. <move
  373. file="${project.build.directory}/tomcat.exp/apache-tomcat-${tomcat.version}"
  374. tofile="${kms.tomcat.dist.dir}"/>
  375. <delete dir="${project.build.directory}/tomcat.exp"/>
  376. <delete dir="${kms.tomcat.dist.dir}/webapps"/>
  377. <mkdir dir="${kms.tomcat.dist.dir}/webapps"/>
  378. <delete file="${kms.tomcat.dist.dir}/conf/server.xml"/>
  379. <copy file="${basedir}/src/main/tomcat/server.xml"
  380. toDir="${kms.tomcat.dist.dir}/conf"/>
  381. <delete file="${kms.tomcat.dist.dir}/conf/ssl-server.xml"/>
  382. <copy file="${basedir}/src/main/tomcat/ssl-server.xml"
  383. toDir="${kms.tomcat.dist.dir}/conf"/>
  384. <delete
  385. file="${kms.tomcat.dist.dir}/conf/logging.properties"/>
  386. <copy file="${basedir}/src/main/tomcat/logging.properties"
  387. toDir="${kms.tomcat.dist.dir}/conf"/>
  388. <copy toDir="${kms.tomcat.dist.dir}/webapps/ROOT">
  389. <fileset dir="${basedir}/src/main/tomcat/ROOT"/>
  390. </copy>
  391. <copy toDir="${kms.tomcat.dist.dir}/webapps/kms">
  392. <fileset dir="${project.build.directory}/kms"/>
  393. </copy>
  394. </target>
  395. </configuration>
  396. </execution>
  397. <execution>
  398. <id>tar</id>
  399. <phase>package</phase>
  400. <goals>
  401. <goal>run</goal>
  402. </goals>
  403. <configuration>
  404. <target if="tar">
  405. <!-- Using Unix script to preserve symlinks -->
  406. <echo file="${project.build.directory}/dist-maketar.sh">
  407. cd "${project.build.directory}"
  408. tar cf - ${project.artifactId}-${project.version} | gzip > ${project.artifactId}-${project.version}.tar.gz
  409. </echo>
  410. <exec executable="sh" dir="${project.build.directory}"
  411. failonerror="true">
  412. <arg line="./dist-maketar.sh"/>
  413. </exec>
  414. </target>
  415. </configuration>
  416. </execution>
  417. </executions>
  418. </plugin>
  419. </plugins>
  420. </build>
  421. </profile>
  422. </profiles>
  423. </project>