HBASE-16574 Book updates for backup and restore
[hbase.git] / hbase-thrift / pom.xml
blob6457b33d38acb694b506beaca8f8d351fdc9a13f
1 <?xml version="1.0"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0"
3          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5   <!--
6 /**
7  * Licensed to the Apache Software Foundation (ASF) under one
8  * or more contributor license agreements.  See the NOTICE file
9  * distributed with this work for additional information
10  * regarding copyright ownership.  The ASF licenses this file
11  * to you under the Apache License, Version 2.0 (the
12  * "License"); you may not use this file except in compliance
13  * with the License.  You may obtain a copy of the License at
14  *
15  *     http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23 -->
24   <modelVersion>4.0.0</modelVersion>
25   <parent>
26     <artifactId>hbase-build-configuration</artifactId>
27     <groupId>org.apache.hbase</groupId>
28     <version>3.0.0-SNAPSHOT</version>
29     <relativePath>../hbase-build-configuration</relativePath>
30   </parent>
31   <artifactId>hbase-thrift</artifactId>
32   <name>Apache HBase - Thrift</name>
33   <description>HBase Thrift Server</description>
35   <build>
36     <!-- Makes sure the resources get added before they are processed
37   by placing this first -->
38     <resources>
39       <!-- Add the build webabpps to the classpth -->
40       <resource>
41         <directory>${project.build.directory}</directory>
42         <includes>
43           <include>hbase-webapps/**</include>
44         </includes>
45       </resource>
46     </resources>
47     <testResources>
48       <testResource>
49         <directory>src/test/resources/META-INF/</directory>
50         <targetPath>META-INF/</targetPath>
51         <includes>
52           <include>LICENSE</include>
53           <include>NOTICE</include>
54         </includes>
55         <filtering>true</filtering>
56       </testResource>
57       <testResource>
58         <directory>src/test/resources</directory>
59         <includes>
60           <include>**/**</include>
61         </includes>
62       </testResource>
63     </testResources>
65     <plugins>
66       <plugin>
67         <groupId>org.apache.maven.plugins</groupId>
68         <artifactId>maven-site-plugin</artifactId>
69         <configuration>
70           <skip>true</skip>
71         </configuration>
72       </plugin>
73       <plugin>
74         <!--Make it so assembly:single does nothing in here-->
75         <artifactId>maven-assembly-plugin</artifactId>
76         <configuration>
77           <skipAssembly>true</skipAssembly>
78         </configuration>
79       </plugin>
80       <!-- General ant tasks, bound to different build phases -->
81       <plugin>
82         <artifactId>maven-antrun-plugin</artifactId>
83         <executions>
84           <!-- Generate web app sources -->
85           <execution>
86             <id>generate</id>
87             <phase>generate-sources</phase>
88             <configuration>
89               <target>
90                 <property name="build.webapps" location="${project.build.directory}/hbase-webapps"/>
91                 <property name="src.webapps"
92                           location="${basedir}/src/main/resources/hbase-webapps"/>
93                 <property name="generated.sources"
94                           location="${project.build.directory}/generated-sources"/>
95                 <mkdir dir="${build.webapps}"/>
96                 <copy todir="${build.webapps}">
97                   <fileset dir="${src.webapps}">
98                     <exclude name="**/*.jsp"/>
99                     <exclude name="**/.*"/>
100                     <exclude name="**/*~"/>
101                   </fileset>
102                 </copy>
103                 <!--The compile.classpath is passed in by maven -->
104                 <taskdef classname="org.apache.jasper.JspC" name="jspcompiler"
105                          classpathref="maven.compile.classpath"/>
106                 <mkdir dir="${build.webapps}/thrift/WEB-INF"/>
107                 <jspcompiler uriroot="${src.webapps}/thrift" outputdir="${generated.sources}/java"
108                              package="org.apache.hadoop.hbase.generated.thrift"
109                              webxml="${build.webapps}/thrift/WEB-INF/web.xml"/>
110               </target>
111             </configuration>
112             <goals>
113               <goal>run</goal>
114             </goals>
115           </execution>
116         </executions>
117       </plugin>
118       <plugin>
119         <groupId>org.codehaus.mojo</groupId>
120         <artifactId>build-helper-maven-plugin</artifactId>
121         <executions>
122           <!-- Add the generated sources -->
123           <execution>
124             <id>jspcSource-packageInfo-source</id>
125             <phase>generate-sources</phase>
126             <goals>
127               <goal>add-source</goal>
128             </goals>
129             <configuration>
130               <sources>
131                 <source>${project.build.directory}/generated-sources/java</source>
132               </sources>
133             </configuration>
134           </execution>
135         </executions>
136       </plugin>
137       <!-- Make a jar and put the sources in the jar -->
138       <plugin>
139         <groupId>org.apache.maven.plugins</groupId>
140         <artifactId>maven-source-plugin</artifactId>
141       </plugin>
142     </plugins>
143     <pluginManagement>
144       <plugins>
145         <!--This plugin's configuration is used to store Eclipse m2e settings
146              only. It has no influence on the Maven build itself.-->
147         <plugin>
148           <groupId>org.eclipse.m2e</groupId>
149           <artifactId>lifecycle-mapping</artifactId>
150           <configuration>
151             <lifecycleMappingMetadata>
152               <pluginExecutions>
153                 <pluginExecution>
154                   <pluginExecutionFilter>
155                     <groupId>org.apache.maven.plugins</groupId>
156                     <artifactId>maven-antrun-plugin</artifactId>
157                     <versionRange>[1.6,)</versionRange>
158                     <goals>
159                       <goal>run</goal>
160                     </goals>
161                   </pluginExecutionFilter>
162                   <action>
163                     <ignore></ignore>
164                   </action>
165                 </pluginExecution>
166                 <pluginExecution>
167                   <pluginExecutionFilter>
168                     <groupId>org.apache.maven.plugins</groupId>
169                     <artifactId>maven-dependency-plugin</artifactId>
170                     <versionRange>[2.8,)</versionRange>
171                     <goals>
172                       <goal>build-classpath</goal>
173                     </goals>
174                   </pluginExecutionFilter>
175                   <action>
176                     <ignore></ignore>
177                   </action>
178                 </pluginExecution>
179                 <pluginExecution>
180                   <pluginExecutionFilter>
181                     <groupId>org.apache.maven.plugins</groupId>
182                     <artifactId>maven-compiler-plugin</artifactId>
183                     <versionRange>[3.2,)</versionRange>
184                     <goals>
185                       <goal>compile</goal>
186                     </goals>
187                   </pluginExecutionFilter>
188                   <action>
189                     <ignore></ignore>
190                   </action>
191                 </pluginExecution>
192               </pluginExecutions>
193             </lifecycleMappingMetadata>
194           </configuration>
195         </plugin>
196       </plugins>
197     </pluginManagement>
198   </build>
200   <dependencies>
201     <!-- Intra-project dependencies -->
202     <dependency>
203       <groupId>org.apache.hbase</groupId>
204       <artifactId>hbase-common</artifactId>
205       <type>jar</type>
206     </dependency>
207     <dependency>
208       <groupId>org.apache.hbase</groupId>
209       <artifactId>hbase-annotations</artifactId>
210       <type>test-jar</type>
211       <scope>test</scope>
212     </dependency>
213     <dependency>
214       <groupId>org.apache.hbase</groupId>
215       <artifactId>hbase-protocol</artifactId>
216     </dependency>
217     <dependency>
218       <groupId>org.apache.hbase</groupId>
219       <artifactId>hbase-client</artifactId>
220     </dependency>
221     <dependency>
222       <groupId>org.apache.hbase.thirdparty</groupId>
223       <artifactId>hbase-shaded-miscellaneous</artifactId>
224     </dependency>
225     <dependency>
226       <groupId>commons-logging</groupId>
227       <artifactId>commons-logging</artifactId>
228     </dependency>
229     <dependency>
230       <groupId>commons-cli</groupId>
231       <artifactId>commons-cli</artifactId>
232     </dependency>
233     <dependency>
234       <groupId>org.apache.commons</groupId>
235       <artifactId>commons-lang3</artifactId>
236     </dependency>
237     <dependency>
238       <groupId>org.apache.commons</groupId>
239       <artifactId>commons-collections4</artifactId>
240     </dependency>
241     <dependency>
242       <groupId>org.apache.hbase</groupId>
243       <artifactId>hbase-server</artifactId>
244     </dependency>
245     <dependency>
246       <groupId>org.apache.hbase</groupId>
247       <artifactId>hbase-testing-util</artifactId>
248       <scope>test</scope>
249     </dependency>
250     <dependency>
251       <groupId>org.apache.hbase</groupId>
252       <artifactId>hbase-hadoop-compat</artifactId>
253     </dependency>
254     <dependency>
255       <groupId>org.apache.hbase</groupId>
256       <artifactId>${compat.module}</artifactId>
257       <version>${project.version}</version>
258     </dependency>
259     <dependency>
260       <groupId>org.apache.thrift</groupId>
261       <artifactId>libthrift</artifactId>
262     </dependency>
263     <dependency>
264       <groupId>org.slf4j</groupId>
265       <artifactId>slf4j-api</artifactId>
266     </dependency>
267     <dependency>
268       <groupId>org.eclipse.jetty</groupId>
269       <artifactId>jetty-server</artifactId>
270     </dependency>
271     <dependency>
272       <groupId>org.eclipse.jetty</groupId>
273       <artifactId>jetty-servlet</artifactId>
274     </dependency>
275     <dependency>
276       <!--Ant task needs this-->
277       <groupId>org.eclipse.jetty</groupId>
278       <artifactId>jetty-jsp</artifactId>
279     </dependency>
280     <dependency>
281       <groupId>junit</groupId>
282       <artifactId>junit</artifactId>
283       <scope>test</scope>
284     </dependency>
285     <dependency>
286       <groupId>org.eclipse.jetty</groupId>
287       <artifactId>jetty-http</artifactId>
288     </dependency>
289     <dependency>
290       <groupId>javax.servlet</groupId>
291       <artifactId>javax.servlet-api</artifactId>
292     </dependency>
293     <dependency>
294       <groupId>org.eclipse.jetty</groupId>
295       <artifactId>jetty-util</artifactId>
296     </dependency>
297     <dependency>
298       <!--For JspC used in ant task-->
299       <groupId>org.glassfish.web</groupId>
300       <artifactId>javax.servlet.jsp</artifactId>
301     </dependency>
302     <!-- Specifically needed for jetty-jsp, included
303          to bypass version scanning that hits a bad repo
304          see HBASE-18831 -->
305     <dependency>
306       <groupId>org.glassfish</groupId>
307       <artifactId>javax.el</artifactId>
308     </dependency>
309   </dependencies>
311   <profiles>
312     <!-- Needs to make the profile in apache parent pom -->
313     <profile>
314       <id>apache-release</id>
315       <build>
316         <plugins>
317           <plugin>
318             <groupId>org.apache.maven.plugins</groupId>
319             <artifactId>maven-resources-plugin</artifactId>
320             <executions>
321               <execution>
322                 <id>license-javadocs</id>
323                 <phase>prepare-package</phase>
324                 <goals>
325                   <goal>copy-resources</goal>
326                 </goals>
327                 <configuration>
328                   <outputDirectory>${project.build.directory}/apidocs</outputDirectory>
329                   <resources>
330                     <resource>
331                       <directory>src/main/javadoc/META-INF/</directory>
332                       <targetPath>META-INF/</targetPath>
333                       <includes>
334                         <include>LICENSE</include>
335                         <include>NOTICE</include>
336                       </includes>
337                       <filtering>true</filtering>
338                     </resource>
339                   </resources>
340                 </configuration>
341               </execution>
342             </executions>
343           </plugin>
344         </plugins>
345       </build>
346     </profile>
347     <!-- Skip the tests in this module -->
348     <profile>
349       <id>skipThriftTests</id>
350       <activation>
351         <property>
352           <name>skipThriftTests</name>
353         </property>
354       </activation>
355       <properties>
356         <surefire.skipFirstPart>true</surefire.skipFirstPart>
357         <surefire.skipSecondPart>true</surefire.skipSecondPart>
358       </properties>
359     </profile>
361     <!--
362       Profile for regenerating the thrift java classes.
363       The generated files are to be committed to version control.
364       Activate using:
365        mvn compile -Pcompile-thrift
366     -->
367     <profile>
368       <id>compile-thrift</id>
369       <build>
370         <plugins>
371           <plugin>
372             <groupId>org.apache.maven.plugins</groupId>
373             <artifactId>maven-enforcer-plugin</artifactId>
374             <executions>
375               <execution>
376                 <id>enforce-thrift-version</id>
377                 <goals>
378                   <goal>enforce</goal>
379                 </goals>
380                 <configuration>
381                   <rules>
382                     <requireProperty>
383                       <property>thrift.version</property>
384                       <message>"The Thrift version must be specified."</message>
385                       <regex>0\.9\.3</regex>
386                       <regexMessage>
389 [FATAL] ==========================================================================================
390 [FATAL] HBase Thrift requires the thrift generator version 0.9.3.
391 [FATAL] Setting it to something else needs to be reviewed for wire and behavior compatibility.
392 [FATAL] ==========================================================================================
395                       </regexMessage>
396                     </requireProperty>
397                   </rules>
398                   <fail>true</fail>
399                 </configuration>
400               </execution>
401             </executions>
402           </plugin>
403           <plugin>
404             <groupId>org.codehaus.mojo</groupId>
405             <artifactId>exec-maven-plugin</artifactId>
406             <version>${exec.maven.version}</version>
407             <executions>
408               <execution>
409                 <id>check-thrift-version</id>
410                 <phase>generate-sources</phase>
411                 <goals>
412                   <goal>exec</goal>
413                 </goals>
414                 <configuration>
415                   <executable>sh</executable>
416                   <workingDirectory>${basedir}</workingDirectory>
417                   <arguments>
418                     <argument>-c</argument>
419                     <argument>${thrift.path} -version | \
420                       fgrep 'Thrift version ${thrift.version}' &amp;&amp; exit 0;
421                       echo "========== [FATAL] Need Thrift version ${thrift.version} ==========";
422                       exit 1</argument>
423                   </arguments>
424                 </configuration>
425               </execution>
426               <execution>
427                 <id>thrift</id>
428                 <phase>generate-sources</phase>
429                 <goals>
430                   <goal>exec</goal>
431                 </goals>
432                 <configuration>
433                   <executable>${thrift.path}</executable>
434                   <workingDirectory>${basedir}</workingDirectory>
435                   <arguments>
436                     <argument>-strict</argument>
437                     <argument>--gen</argument>
438                     <argument>java:hashcode</argument>
439                     <argument>-out</argument>
440                     <argument>${basedir}/src/main/java</argument>
441                     <argument>${basedir}/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift</argument>
442                   </arguments>
443                 </configuration>
444               </execution>
445               <execution>
446                 <id>thrift2</id>
447                 <phase>generate-sources</phase>
448                 <goals>
449                   <goal>exec</goal>
450                 </goals>
451                 <configuration>
452                   <executable>${thrift.path}</executable>
453                   <workingDirectory>${basedir}</workingDirectory>
454                   <arguments>
455                     <argument>-strict</argument>
456                     <argument>--gen</argument>
457                     <argument>java:hashcode</argument>
458                     <argument>-out</argument>
459                     <argument>${basedir}/src/main/java</argument>
460                     <argument>${basedir}/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift</argument>
461                   </arguments>
462                 </configuration>
463               </execution>
464             </executions>
465           </plugin>
466         </plugins>
467       </build>
468     </profile>
470     <!-- profile against Hadoop 2.x: This is the default -->
471     <profile>
472       <id>hadoop-2.0</id>
473       <activation>
474         <property>
475           <!--Below formatting for dev-support/generate-hadoopX-poms.sh-->
476           <!--h2-->
477           <name>!hadoop.profile</name>
478         </property>
479       </activation>
480       <dependencies>
481         <dependency>
482           <groupId>org.apache.hadoop</groupId>
483           <artifactId>hadoop-client</artifactId>
484           <exclusions>
485             <exclusion>
486               <groupId>com.google.guava</groupId>
487               <artifactId>guava</artifactId>
488             </exclusion>
489           </exclusions>
490         </dependency>
491         <dependency>
492           <groupId>org.apache.hadoop</groupId>
493           <artifactId>hadoop-mapreduce-client-core</artifactId>
494           <exclusions>
495             <exclusion>
496               <groupId>com.google.guava</groupId>
497               <artifactId>guava</artifactId>
498             </exclusion>
499           </exclusions>
500         </dependency>
501         <dependency>
502           <groupId>org.apache.hadoop</groupId>
503           <artifactId>hadoop-mapreduce-client-jobclient</artifactId>
504           <type>test-jar</type>
505           <scope>test</scope>
506           <exclusions>
507             <exclusion>
508               <groupId>com.google.guava</groupId>
509               <artifactId>guava</artifactId>
510             </exclusion>
511           </exclusions>
512         </dependency>
513         <dependency>
514           <groupId>org.apache.hadoop</groupId>
515           <artifactId>hadoop-common</artifactId>
516           <exclusions>
517             <exclusion>
518               <groupId>org.apache.htrace</groupId>
519               <artifactId>htrace-core</artifactId>
520             </exclusion>
521           </exclusions>
522         </dependency>
523         <dependency>
524           <groupId>org.apache.hadoop</groupId>
525           <artifactId>hadoop-minicluster</artifactId>
526           <scope>test</scope>
527           <exclusions>
528             <exclusion>
529               <groupId>org.apache.htrace</groupId>
530               <artifactId>htrace-core</artifactId>
531             </exclusion>
532             <exclusion>
533               <groupId>com.google.guava</groupId>
534               <artifactId>guava</artifactId>
535             </exclusion>
536           </exclusions>
537         </dependency>
538       </dependencies>
539       <build>
540         <plugins>
541           <plugin>
542             <artifactId>maven-dependency-plugin</artifactId>
543             <executions>
544               <execution>
545                 <id>create-mrapp-generated-classpath</id>
546                 <phase>generate-test-resources</phase>
547                 <goals>
548                   <goal>build-classpath</goal>
549                 </goals>
550                 <configuration>
551                   <!-- needed to run the unit test for DS to generate
552                   the required classpath that is required in the env
553                   of the launch container in the mini mr/yarn cluster
554                   -->
555                   <outputFile>${project.build.directory}/test-classes/mrapp-generated-classpath
556                   </outputFile>
557                 </configuration>
558               </execution>
559             </executions>
560           </plugin>
561         </plugins>
562       </build>
563     </profile>
565     <!--
566       profile for building against Hadoop 3.0.x. Activate using:
567        mvn -Dhadoop.profile=3.0
568     -->
569     <profile>
570       <id>hadoop-3.0</id>
571       <activation>
572         <property>
573           <name>hadoop.profile</name>
574           <value>3.0</value>
575         </property>
576       </activation>
577       <properties>
578         <hadoop.version>3.0-SNAPSHOT</hadoop.version>
579       </properties>
580       <dependencies>
581         <dependency>
582           <groupId>org.apache.hadoop</groupId>
583           <artifactId>hadoop-common</artifactId>
584           <exclusions>
585             <exclusion>
586               <groupId>org.apache.htrace</groupId>
587               <artifactId>htrace-core</artifactId>
588             </exclusion>
589           </exclusions>
590         </dependency>
591         <dependency>
592           <groupId>org.apache.hadoop</groupId>
593           <artifactId>hadoop-minicluster</artifactId>
594           <exclusions>
595             <exclusion>
596               <groupId>org.apache.htrace</groupId>
597               <artifactId>htrace-core</artifactId>
598             </exclusion>
599           </exclusions>
600         </dependency>
601       </dependencies>
602       <build>
603         <plugins>
604           <plugin>
605             <artifactId>maven-dependency-plugin</artifactId>
606             <executions>
607               <execution>
608                 <id>create-mrapp-generated-classpath</id>
609                 <phase>generate-test-resources</phase>
610                 <goals>
611                   <goal>build-classpath</goal>
612                 </goals>
613                 <configuration>
614                   <!-- needed to run the unit test for DS to generate
615                   the required classpath that is required in the env
616                   of the launch container in the mini mr/yarn cluster
617                   -->
618                   <outputFile>${project.build.directory}/test-classes/mrapp-generated-classpath
619                   </outputFile>
620                 </configuration>
621               </execution>
622             </executions>
623           </plugin>
624         </plugins>
625       </build>
626     </profile>
627   </profiles>
628 </project>