HBASE-22943 Various procedures should not cache log trace level (#557)
[hbase.git] / hbase-protocol-shaded / pom.xml
blob6cbc020f626a3806bdf4ad18c5c39bc778888a40
1 <?xml version="1.0"?>
2 <project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3   <!--
4     /**
5      * Licensed to the Apache Software Foundation (ASF) under one
6      * or more contributor license agreements.  See the NOTICE file
7      * distributed with this work for additional information
8      * regarding copyright ownership.  The ASF licenses this file
9      * to you under the Apache License, Version 2.0 (the
10      * "License"); you may not use this file except in compliance
11      * with the License.  You may obtain a copy of the License at
12      *
13      *     http://www.apache.org/licenses/LICENSE-2.0
14      *
15      * Unless required by applicable law or agreed to in writing, software
16      * distributed under the License is distributed on an "AS IS" BASIS,
17      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18      * See the License for the specific language governing permissions and
19      * limitations under the License.
20      */
21     -->
22   <modelVersion>4.0.0</modelVersion>
23   <parent>
24     <artifactId>hbase-build-configuration</artifactId>
25     <groupId>org.apache.hbase</groupId>
26     <version>3.0.0-SNAPSHOT</version>
27     <relativePath>../hbase-build-configuration</relativePath>
28   </parent>
29   <artifactId>hbase-protocol-shaded</artifactId>
30   <name>Apache HBase - Shaded Protocol</name>
31   <description>Shaded protobuf protocol classes used by HBase internally.</description>
32   <properties>
33     <maven.javadoc.skip>true</maven.javadoc.skip>
34     <!--Version of protobuf that hbase uses internally (we shade our pb)
35          Must match what is out in hbase-thirdparty include.
36          3.5.1-1 is the same as 3.5.1 except includes corrected binaries for el6
37          to work around https://github.com/google/protobuf/issues/4109
38            -->
39     <internal.protobuf.version>3.5.1-1</internal.protobuf.version>
40   </properties>
41   <build>
42     <resources>
43       <resource>
44         <directory>src/main/</directory>
45         <includes>
46           <include>**/*.proto</include>
47         </includes>
48       </resource>
49     </resources>
50     <plugins>
51       <!-- Make a jar and put the sources in the jar -->
52       <plugin>
53         <groupId>org.apache.maven.plugins</groupId>
54         <artifactId>maven-source-plugin</artifactId>
55                   </plugin>
56       <plugin>
57         <!--Make it so assembly:single does nothing in here-->
58         <artifactId>maven-assembly-plugin</artifactId>
59         <configuration>
60           <skipAssembly>true</skipAssembly>
61         </configuration>
62       </plugin>
63       <plugin>
64         <artifactId>maven-surefire-plugin</artifactId>
65         <!-- Always skip the second part executions, since we only run simple unit tests in this module -->
66         <executions>
67           <execution>
68             <id>secondPartTestsExecution</id>
69             <phase>test</phase>
70             <goals>
71               <goal>test</goal>
72             </goals>
73             <configuration>
74               <skip>true</skip>
75             </configuration>
76           </execution>
77         </executions>
78       </plugin>
79       <plugin>
80         <groupId>org.xolstice.maven.plugins</groupId>
81         <artifactId>protobuf-maven-plugin</artifactId>
82         <executions>
83           <execution>
84             <id>compile-protoc</id>
85             <phase>generate-sources</phase>
86             <goals>
87               <goal>compile</goal>
88             </goals>
89             <configuration>
90               <protocArtifact>com.google.protobuf:protoc:${internal.protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
91               <attachProtoSources>false</attachProtoSources>
92               <checkStaleness>true</checkStaleness>
93             </configuration>
94           </execution>
95         </executions>
96       </plugin>
97       <!--Need this old plugin to replace in generated files instances
98            of com.google.protobuf so instead its o.a.h.h.com.google.protobuf.
99            Plugin is old and in google code archive. Here is usage done by
100            anohther: https://github.com/beiliubei/maven-replacer-plugin/wiki/Usage-Guide
101            The mess with the regex in the below is to prevent replacement every time
102            we run mvn install. There is probably a better way of avoiding the
103            double interpolation but this is it for now.
104         -->
105       <plugin>
106         <groupId>com.google.code.maven-replacer-plugin</groupId>
107         <artifactId>replacer</artifactId>
108         <version>1.5.3</version>
109         <executions>
110           <execution>
111             <phase>process-sources</phase>
112             <goals>
113               <goal>replace</goal>
114             </goals>
115           </execution>
116         </executions>
117         <configuration>
118           <basedir>${basedir}/target/generated-sources/</basedir>
119             <includes>
120                 <include>**/*.java</include>
121             </includes>
122             <!-- Ignore errors when missing files, because it means this build
123                  was run with -Dprotoc.skip and there is no -Dreplacer.skip -->
124             <ignoreErrors>true</ignoreErrors>
125             <replacements>
126               <replacement>
127                 <token>([^\.])com.google.protobuf</token>
128                 <value>$1org.apache.hbase.thirdparty.com.google.protobuf</value>
129               </replacement>
130               <replacement>
131                 <token>(public)(\W+static)?(\W+final)?(\W+class)</token>
132                 <value>@javax.annotation.Generated("proto") $1$2$3$4</value>
133               </replacement>
134               <!-- replacer doesn't support anchoring or negative lookbehind -->
135               <replacement>
136                 <token>(@javax.annotation.Generated\("proto"\) ){2}</token>
137                 <value>$1</value>
138               </replacement>
139             </replacements>
140         </configuration>
141       </plugin>
142       <plugin>
143         <groupId>org.apache.maven.plugins</groupId>
144         <artifactId>maven-shade-plugin</artifactId>
145         <executions>
146           <execution>
147             <phase>package</phase>
148             <goals>
149               <goal>shade</goal>
150             </goals>
151             <configuration>
152               <minimizeJar>true</minimizeJar>
153               <shadeSourcesContent>true</shadeSourcesContent>
154               <!-- Causes an NPE until shade 3.0.1.  See MSHADE-247
155               <createSourcesJar>true</createSourcesJar>
156               -->
157               <relocations>
158                 <relocation>
159                   <pattern>com.google.protobuf</pattern>
160                   <shadedPattern>org.apache.hadoop.hbase.shaded.com.google.protobuf</shadedPattern>
161                 </relocation>
162               </relocations>
163               <artifactSet>
164                 <excludes>
165                   <!-- exclude J2EE modules that come in for JDK11+ or modules that come in for
166                   JDK8+ but need not be included -->
167                   <exclude>javax.annotation:javax.annotation-api</exclude>
168                   <!--Exclude protobuf itself. We get a patched version from hbase-thirdparty.
169                     -->
170                   <exclude>org.apache.hbase.thirdparty:*</exclude>
171                   <exclude>com.google.protobuf:protobuf-java</exclude>
172                   <exclude>com.google.code.findbugs:*</exclude>
173                   <exclude>com.google.j2objc:j2objc-annotations</exclude>
174                   <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude>
175                   <exclude>junit:junit</exclude>
176                   <exclude>log4j:log4j</exclude>
177                   <exclude>commons-logging:commons-logging</exclude>
178                   <exclude>org.slf4j:slf4j-api</exclude>
179                   <exclude>org.apache.yetus:audience-annotations</exclude>
180                   <exclude>com.github.stephenc.fingbugs:*</exclude>
181                   <exclude></exclude>
182                 </excludes>
183               </artifactSet>
184             </configuration>
185           </execution>
186         </executions>
187       </plugin>
188       <plugin>
189         <groupId>org.apache.maven.plugins</groupId>
190         <artifactId>maven-checkstyle-plugin</artifactId>
191         <configuration>
192           <failOnViolation>true</failOnViolation>
193         </configuration>
194       </plugin>
195       <plugin>
196         <groupId>net.revelc.code</groupId>
197         <artifactId>warbucks-maven-plugin</artifactId>
198       </plugin>
199     </plugins>
200   </build>
201   <dependencies>
202     <!--BE CAREFUL! Any dependency added here needs to be
203           excluded above in the shade plugin else the dependency
204           will get bundled-->
205     <!-- Intra-project dependencies -->
206     <dependency>
207       <groupId>org.apache.hbase.thirdparty</groupId>
208       <artifactId>hbase-shaded-protobuf</artifactId>
209     </dependency>
210     <dependency>
211       <groupId>junit</groupId>
212       <artifactId>junit</artifactId>
213       <scope>test</scope>
214     </dependency>
215     <dependency>
216       <groupId>org.apache.htrace</groupId>
217       <artifactId>htrace-core4</artifactId>
218     </dependency>
219   </dependencies>
220   <profiles>
221     <!-- Skip the tests in this module -->
222     <profile>
223       <id>skip-protocol-shaded-tests</id>
224       <activation>
225         <property>
226           <name>skip-protocol-shaded-tests</name>
227         </property>
228       </activation>
229       <properties>
230         <surefire.skipFirstPart>true</surefire.skipFirstPart>
231         <surefire.skipSecondPart>true</surefire.skipSecondPart>
232       </properties>
233     </profile>
234     <profile>
235       <id>build-with-jdk11</id>
236       <activation>
237         <jdk>[1.11,)</jdk>
238       </activation>
239       <dependencies>
240         <dependency>
241           <groupId>javax.annotation</groupId>
242           <artifactId>javax.annotation-api</artifactId>
243         </dependency>
244       </dependencies>
245     </profile>
246     <profile>
247       <id>eclipse-specific</id>
248       <activation>
249         <property>
250           <name>m2e.version</name>
251         </property>
252       </activation>
253       <build>
254         <pluginManagement>
255           <plugins>
256             <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
257             <plugin>
258               <groupId>org.eclipse.m2e</groupId>
259               <artifactId>lifecycle-mapping</artifactId>
260               <configuration>
261                 <lifecycleMappingMetadata>
262                   <pluginExecutions>
263                     <pluginExecution>
264                       <pluginExecutionFilter>
265                         <groupId>org.apache.hadoop</groupId>
266                         <artifactId>hadoop-maven-plugins</artifactId>
267                         <versionRange>[2.0.5-alpha,)</versionRange>
268                         <goals>
269                           <goal>protoc</goal>
270                         </goals>
271                       </pluginExecutionFilter>
272                       <action>
273                         <ignore/>
274                       </action>
275                     </pluginExecution>
276                     <pluginExecution>
277                       <pluginExecutionFilter>
278                         <groupId>
279                           com.google.code.maven-replacer-plugin
280                         </groupId>
281                         <artifactId>replacer</artifactId>
282                         <versionRange>[1.5.3,)</versionRange>
283                         <goals>
284                           <goal>replace</goal>
285                         </goals>
286                       </pluginExecutionFilter>
287                       <action>
288                         <execute>
289                          <runOnIncremental>false</runOnIncremental>
290                         </execute>
291                       </action>
292                     </pluginExecution>
293                   </pluginExecutions>
294                 </lifecycleMappingMetadata>
295               </configuration>
296             </plugin>
297           </plugins>
298         </pluginManagement>
299       </build>
300     </profile>
301   </profiles>
302 </project>