pom.xml 15 KB

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