Skip to content

Commit 36be9fd

Browse files
author
Joseph295
committed
HBASE-24168 Align the internal.protobuf.version in hbase-protocol-shaded with hbase-thirdparty
1 parent cc4aaef commit 36be9fd

2 files changed

Lines changed: 52 additions & 13 deletions

File tree

hbase-examples/pom.xml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@
2929
<artifactId>hbase-examples</artifactId>
3030
<name>Apache HBase - Examples</name>
3131
<description>Examples of HBase usage</description>
32-
<!--REMOVE-->
32+
<properties>
33+
<!--Version of protobuf that hbase uses internally (we shade our pb)
34+
Must match what is out in hbase-thirdparty include.
35+
-->
36+
<internal.protobuf.version>3.11.4</internal.protobuf.version>
37+
</properties>
3338
<build>
3439
<plugins>
3540
<plugin>
@@ -62,9 +67,50 @@
6267
<goals>
6368
<goal>compile</goal>
6469
</goals>
70+
<configuration>
71+
<protocArtifact>com.google.protobuf:protoc:${internal.protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
72+
<checkStaleness>true</checkStaleness>
73+
</configuration>
6574
</execution>
6675
</executions>
6776
</plugin>
77+
<plugin>
78+
<groupId>com.google.code.maven-replacer-plugin</groupId>
79+
<artifactId>replacer</artifactId>
80+
<version>1.5.3</version>
81+
<executions>
82+
<execution>
83+
<phase>process-sources</phase>
84+
<goals>
85+
<goal>replace</goal>
86+
</goals>
87+
</execution>
88+
</executions>
89+
<configuration>
90+
<basedir>${basedir}/target/generated-sources/</basedir>
91+
<includes>
92+
<include>**/*.java</include>
93+
</includes>
94+
<!-- Ignore errors when missing files, because it means this build
95+
was run with -Dprotoc.skip and there is no -Dreplacer.skip -->
96+
<ignoreErrors>true</ignoreErrors>
97+
<replacements>
98+
<replacement>
99+
<token>([^\.])com.google.protobuf</token>
100+
<value>$1org.apache.hbase.thirdparty.com.google.protobuf</value>
101+
</replacement>
102+
<replacement>
103+
<token>(public)(\W+static)?(\W+final)?(\W+class)</token>
104+
<value>@javax.annotation.Generated("proto") $1$2$3$4</value>
105+
</replacement>
106+
<!-- replacer doesn't support anchoring or negative lookbehind -->
107+
<replacement>
108+
<token>(@javax.annotation.Generated\("proto"\) ){2}</token>
109+
<value>$1</value>
110+
</replacement>
111+
</replacements>
112+
</configuration>
113+
</plugin>
68114
<plugin>
69115
<groupId>net.revelc.code</groupId>
70116
<artifactId>warbucks-maven-plugin</artifactId>
@@ -87,6 +133,10 @@
87133
<groupId>org.apache.hbase.thirdparty</groupId>
88134
<artifactId>hbase-shaded-netty</artifactId>
89135
</dependency>
136+
<dependency>
137+
<groupId>org.apache.hbase</groupId>
138+
<artifactId>hbase-protocol-shaded</artifactId>
139+
</dependency>
90140
<dependency>
91141
<groupId>org.apache.hbase</groupId>
92142
<artifactId>hbase-common</artifactId>

hbase-protocol-shaded/pom.xml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,10 @@
3333
<maven.javadoc.skip>true</maven.javadoc.skip>
3434
<!--Version of protobuf that hbase uses internally (we shade our pb)
3535
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
3836
-->
39-
<internal.protobuf.version>3.5.1-1</internal.protobuf.version>
37+
<internal.protobuf.version>3.11.4</internal.protobuf.version>
4038
</properties>
4139
<build>
42-
<resources>
43-
<resource>
44-
<directory>src/main/</directory>
45-
<includes>
46-
<include>**/*.proto</include>
47-
</includes>
48-
</resource>
49-
</resources>
5040
<plugins>
5141
<!-- Make a jar and put the sources in the jar -->
5242
<plugin>
@@ -88,7 +78,6 @@
8878
</goals>
8979
<configuration>
9080
<protocArtifact>com.google.protobuf:protoc:${internal.protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
91-
<attachProtoSources>false</attachProtoSources>
9281
<checkStaleness>true</checkStaleness>
9382
</configuration>
9483
</execution>

0 commit comments

Comments
 (0)