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