Revert "HBASE-25134 Migrate HBase PreCommit jenkins job from Hadoop to hbase (#2488)"
[hbase.git] / hbase-protocol-shaded / pom.xml
blob6d8b0ab5775fa04e4d77c2972fa08a6357894514
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     -->
37     <internal.protobuf.version>3.11.4</internal.protobuf.version>
38   </properties>
39   <build>
40     <plugins>
41       <!-- Make a jar and put the sources in the jar -->
42       <plugin>
43         <groupId>org.apache.maven.plugins</groupId>
44         <artifactId>maven-source-plugin</artifactId>
45                   </plugin>
46       <plugin>
47         <!--Make it so assembly:single does nothing in here-->
48         <artifactId>maven-assembly-plugin</artifactId>
49         <configuration>
50           <skipAssembly>true</skipAssembly>
51         </configuration>
52       </plugin>
53       <plugin>
54         <artifactId>maven-surefire-plugin</artifactId>
55         <!-- Always skip the second part executions, since we only run simple unit tests in this module -->
56         <executions>
57           <execution>
58             <id>secondPartTestsExecution</id>
59             <phase>test</phase>
60             <goals>
61               <goal>test</goal>
62             </goals>
63             <configuration>
64               <skip>true</skip>
65             </configuration>
66           </execution>
67         </executions>
68       </plugin>
69       <plugin>
70         <groupId>org.xolstice.maven.plugins</groupId>
71         <artifactId>protobuf-maven-plugin</artifactId>
72         <executions>
73           <execution>
74             <id>compile-protoc</id>
75             <phase>generate-sources</phase>
76             <goals>
77               <goal>compile</goal>
78             </goals>
79             <configuration>
80               <protocArtifact>com.google.protobuf:protoc:${internal.protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
81               <checkStaleness>true</checkStaleness>
82             </configuration>
83           </execution>
84         </executions>
85       </plugin>
86       <!--Need this old plugin to replace in generated files instances
87            of com.google.protobuf so instead its o.a.h.h.com.google.protobuf.
88            Plugin is old and in google code archive. Here is usage done by
89            anohther: https://github.com/beiliubei/maven-replacer-plugin/wiki/Usage-Guide
90            The mess with the regex in the below is to prevent replacement every time
91            we run mvn install. There is probably a better way of avoiding the
92            double interpolation but this is it for now.
93         -->
94       <plugin>
95         <groupId>com.google.code.maven-replacer-plugin</groupId>
96         <artifactId>replacer</artifactId>
97         <version>1.5.3</version>
98         <executions>
99           <execution>
100             <phase>process-sources</phase>
101             <goals>
102               <goal>replace</goal>
103             </goals>
104           </execution>
105         </executions>
106         <configuration>
107           <basedir>${basedir}/target/generated-sources/</basedir>
108             <includes>
109                 <include>**/*.java</include>
110             </includes>
111             <!-- Ignore errors when missing files, because it means this build
112                  was run with -Dprotoc.skip and there is no -Dreplacer.skip -->
113             <ignoreErrors>true</ignoreErrors>
114             <replacements>
115               <replacement>
116                 <token>([^\.])com.google.protobuf</token>
117                 <value>$1org.apache.hbase.thirdparty.com.google.protobuf</value>
118               </replacement>
119               <replacement>
120                 <token>(public)(\W+static)?(\W+final)?(\W+class)</token>
121                 <value>@javax.annotation.Generated("proto") $1$2$3$4</value>
122               </replacement>
123               <!-- replacer doesn't support anchoring or negative lookbehind -->
124               <replacement>
125                 <token>(@javax.annotation.Generated\("proto"\) ){2}</token>
126                 <value>$1</value>
127               </replacement>
128             </replacements>
129         </configuration>
130       </plugin>
131       <plugin>
132         <groupId>org.apache.maven.plugins</groupId>
133         <artifactId>maven-shade-plugin</artifactId>
134         <executions>
135           <execution>
136             <phase>package</phase>
137             <goals>
138               <goal>shade</goal>
139             </goals>
140             <configuration>
141               <minimizeJar>true</minimizeJar>
142               <shadeSourcesContent>true</shadeSourcesContent>
143               <!-- Causes an NPE until shade 3.0.1.  See MSHADE-247
144               <createSourcesJar>true</createSourcesJar>
145               -->
146               <relocations>
147                 <relocation>
148                   <pattern>com.google.protobuf</pattern>
149                   <shadedPattern>org.apache.hadoop.hbase.shaded.com.google.protobuf</shadedPattern>
150                 </relocation>
151               </relocations>
152               <artifactSet>
153                 <excludes>
154                   <!-- exclude J2EE modules that come in for JDK11+ or modules that come in for
155                   JDK8+ but need not be included -->
156                   <exclude>javax.annotation:javax.annotation-api</exclude>
157                   <!--Exclude protobuf itself. We get a patched version from hbase-thirdparty.
158                     -->
159                   <exclude>org.apache.hbase.thirdparty:*</exclude>
160                   <exclude>com.google.protobuf:protobuf-java</exclude>
161                   <exclude>com.google.code.findbugs:*</exclude>
162                   <exclude>com.google.j2objc:j2objc-annotations</exclude>
163                   <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude>
164                   <exclude>junit:junit</exclude>
165                   <exclude>log4j:log4j</exclude>
166                   <exclude>commons-logging:commons-logging</exclude>
167                   <exclude>org.slf4j:slf4j-api</exclude>
168                   <exclude>org.apache.yetus:audience-annotations</exclude>
169                   <exclude>com.github.stephenc.fingbugs:*</exclude>
170                   <exclude>com.github.spotbugs:*</exclude>
171                 </excludes>
172               </artifactSet>
173             </configuration>
174           </execution>
175         </executions>
176       </plugin>
177       <plugin>
178         <groupId>org.apache.maven.plugins</groupId>
179         <artifactId>maven-checkstyle-plugin</artifactId>
180         <configuration>
181           <failOnViolation>true</failOnViolation>
182         </configuration>
183       </plugin>
184       <plugin>
185         <groupId>net.revelc.code</groupId>
186         <artifactId>warbucks-maven-plugin</artifactId>
187       </plugin>
188     </plugins>
189   </build>
190   <dependencies>
191     <!--BE CAREFUL! Any dependency added here needs to be
192           excluded above in the shade plugin else the dependency
193           will get bundled-->
194     <!-- Intra-project dependencies -->
195     <dependency>
196       <groupId>org.apache.hbase.thirdparty</groupId>
197       <artifactId>hbase-shaded-protobuf</artifactId>
198     </dependency>
199     <dependency>
200       <groupId>junit</groupId>
201       <artifactId>junit</artifactId>
202       <scope>test</scope>
203     </dependency>
204     <dependency>
205       <groupId>org.apache.htrace</groupId>
206       <artifactId>htrace-core4</artifactId>
207     </dependency>
208   </dependencies>
209   <profiles>
210     <!-- Skip the tests in this module -->
211     <profile>
212       <id>skip-protocol-shaded-tests</id>
213       <activation>
214         <property>
215           <name>skip-protocol-shaded-tests</name>
216         </property>
217       </activation>
218       <properties>
219         <surefire.skipFirstPart>true</surefire.skipFirstPart>
220         <surefire.skipSecondPart>true</surefire.skipSecondPart>
221       </properties>
222     </profile>
223     <profile>
224       <id>build-with-jdk11</id>
225       <activation>
226         <jdk>[1.11,)</jdk>
227       </activation>
228       <dependencies>
229         <dependency>
230           <groupId>javax.annotation</groupId>
231           <artifactId>javax.annotation-api</artifactId>
232         </dependency>
233       </dependencies>
234     </profile>
235     <profile>
236       <id>eclipse-specific</id>
237       <activation>
238         <property>
239           <name>m2e.version</name>
240         </property>
241       </activation>
242       <build>
243         <pluginManagement>
244           <plugins>
245             <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
246             <plugin>
247               <groupId>org.eclipse.m2e</groupId>
248               <artifactId>lifecycle-mapping</artifactId>
249               <configuration>
250                 <lifecycleMappingMetadata>
251                   <pluginExecutions>
252                     <pluginExecution>
253                       <pluginExecutionFilter>
254                         <groupId>org.apache.hadoop</groupId>
255                         <artifactId>hadoop-maven-plugins</artifactId>
256                         <versionRange>[2.0.5-alpha,)</versionRange>
257                         <goals>
258                           <goal>protoc</goal>
259                         </goals>
260                       </pluginExecutionFilter>
261                       <action>
262                         <ignore/>
263                       </action>
264                     </pluginExecution>
265                     <pluginExecution>
266                       <pluginExecutionFilter>
267                         <groupId>
268                           com.google.code.maven-replacer-plugin
269                         </groupId>
270                         <artifactId>replacer</artifactId>
271                         <versionRange>[1.5.3,)</versionRange>
272                         <goals>
273                           <goal>replace</goal>
274                         </goals>
275                       </pluginExecutionFilter>
276                       <action>
277                         <execute>
278                          <runOnIncremental>false</runOnIncremental>
279                         </execute>
280                       </action>
281                     </pluginExecution>
282                   </pluginExecutions>
283                 </lifecycleMappingMetadata>
284               </configuration>
285             </plugin>
286           </plugins>
287         </pluginManagement>
288       </build>
289     </profile>
290   </profiles>
291 </project>