pom.xml 15 KB

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