Skip to content

Commit df0a821

Browse files
deps: unflatten deps for 1x shaded and hadoop (#4223)
* deps: unflatten deps for 1x shaded and hadoop * order deps as: hbase, then bigtable, then bigtable-hbase * mark all annotation deps as provided * mark conscrypt as provided, which is optional as provided, end users will need to add it themselves if it is needed * some formatting changes * ensure that dep tree of bigtable & hbase are separately respected At this point both of the artifacts (w/o any other deps) can be dropped into the HBASE_CLASSPATH and allow the end user to connect to bigtable Change-Id: Ib5f26213b82eceab876038b14687c96eeee07486 * tweaks Change-Id: I3c0d154add2409ca04e1d59c855198b27845388a
1 parent afb1802 commit df0a821

File tree

3 files changed

+124
-229
lines changed
  • bigtable-hbase-1.x-parent

3 files changed

+124
-229
lines changed

bigtable-hbase-1.x-parent/bigtable-hbase-1.x-hadoop/pom.xml

Lines changed: 42 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ limitations under the License.
3030
bigtable-hbase-1.x.
3131
</description>
3232

33-
<properties>
34-
<!-- define a property that can be ignored by renovate -->
35-
<hbase1-hadoop-slf4j.version>1.6.1</hbase1-hadoop-slf4j.version>
36-
</properties>
37-
3833
<dependencies>
3934
<dependency>
4035
<groupId>${project.groupId}</groupId>
@@ -47,8 +42,8 @@ limitations under the License.
4742
<artifactId>hbase-shaded-client</artifactId>
4843
</exclusion>
4944
<exclusion>
50-
<groupId>com.google.code.findbugs</groupId>
51-
<artifactId>jsr305</artifactId>
45+
<groupId>ch.qos.reload4j</groupId>
46+
<artifactId>reload4j</artifactId>
5247
</exclusion>
5348

5449
<!-- Workaround MNG-5899 & MSHADE-206. Maven >= 3.3.0 doesn't use the dependency reduced
@@ -73,33 +68,22 @@ limitations under the License.
7368
</exclusion>
7469
</exclusions>
7570
</dependency>
71+
7672
<dependency>
7773
<groupId>org.apache.hbase</groupId>
7874
<artifactId>hbase-client</artifactId>
7975
<version>${hbase1.version}</version>
80-
</dependency>
81-
82-
<!-- Manually promote dependencies: This is necessary to avoid flattening hbase-shaded-client's dependency tree -->
83-
<dependency>
84-
<groupId>commons-logging</groupId>
85-
<artifactId>commons-logging</artifactId>
86-
<version>${commons-logging.version}</version>
76+
<exclusions>
77+
<exclusion>
78+
<groupId>log4j</groupId>
79+
<artifactId>log4j</artifactId>
80+
</exclusion>
81+
</exclusions>
8782
</dependency>
8883
<dependency>
8984
<groupId>ch.qos.reload4j</groupId>
9085
<artifactId>reload4j</artifactId>
9186
<version>${reload4j.version}</version>
92-
<scope>runtime</scope>
93-
</dependency>
94-
95-
<!-- unlike hbase-shaded-client, hbase-client depends on slf4j 1.6.1.
96-
Which is older than the version requested by metrics-core. However,
97-
metrics-core will work fine with the older version and we want to stay
98-
compatible with hbase-client deps -->
99-
<dependency>
100-
<groupId>org.slf4j</groupId>
101-
<artifactId>slf4j-api</artifactId>
102-
<version>${hbase1-hadoop-slf4j.version}</version>
10387
</dependency>
10488

10589
<!-- Test deps -->
@@ -112,34 +96,31 @@ limitations under the License.
11296
</dependencies>
11397

11498
<build>
115-
<plugins>
116-
<!-- disable google-cloud-shared-config enforcement checks because
117-
hbase-client's dependency subtree doesn't follow the same rules and is
118-
unable to be fixed here -->
119-
<plugin>
120-
<groupId>org.apache.maven.plugins</groupId>
121-
<artifactId>maven-enforcer-plugin</artifactId>
122-
<executions>
123-
<execution>
124-
<id>enforce</id>
125-
<configuration>
126-
<skip>true</skip>
127-
</configuration>
128-
</execution>
129-
<!-- This must be a drop in replacement for hbase-client, so can't
130-
manage hbase's deps -->
131-
<execution>
132-
<id>enforce-banned-deps</id>
133-
<goals>
134-
<goal>enforce</goal>
135-
</goals>
136-
<configuration>
137-
<skip>true</skip>
138-
</configuration>
139-
</execution>
140-
</executions>
141-
</plugin>
99+
<pluginManagement>
100+
<plugins>
101+
<plugin>
102+
<groupId>org.apache.maven.plugins</groupId>
103+
<artifactId>maven-enforcer-plugin</artifactId>
104+
<executions>
105+
<execution>
106+
<id>enforce</id>
107+
<!-- requireUpperBoundDeps, banDuplicateClasses -->
108+
<configuration>
109+
<skip>true</skip>
110+
</configuration>
111+
</execution>
112+
<execution>
113+
<id>enforce-banned-deps</id>
114+
<configuration>
115+
<skip>true</skip>
116+
</configuration>
117+
</execution>
118+
</executions>
119+
</plugin>
120+
</plugins>
121+
</pluginManagement>
142122

123+
<plugins>
143124
<plugin>
144125
<groupId>org.apache.maven.plugins</groupId>
145126
<artifactId>maven-shade-plugin</artifactId>
@@ -153,9 +134,12 @@ limitations under the License.
153134
<shadedArtifactAttached>false</shadedArtifactAttached>
154135
<createDependencyReducedPom>true</createDependencyReducedPom>
155136
<!-- Need to manually promote to dependencies to keep the structure of hbase-shade-client -->
156-
<promoteTransitiveDependencies>
157-
false
158-
</promoteTransitiveDependencies>
137+
<promoteTransitiveDependencies>false</promoteTransitiveDependencies>
138+
<transformers>
139+
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
140+
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"/>
141+
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
142+
</transformers>
159143
<filters>
160144
<filter>
161145
<artifact>*:*</artifact>
@@ -166,29 +150,11 @@ limitations under the License.
166150
</excludes>
167151
</filter>
168152
</filters>
169-
<transformers>
170-
<transformer
171-
implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
172-
<transformer
173-
implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"/>
174-
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
175-
</transformers>
176153
<artifactSet>
177154
<includes>
178-
<include>
179-
com.google.cloud.bigtable:bigtable-hbase-1.x-shaded
180-
</include>
155+
<include>com.google.cloud.bigtable:bigtable-hbase-1.x-shaded</include>
181156
</includes>
182157
</artifactSet>
183-
<relocations>
184-
<!-- Undo the relocation that hbase-shaded-client did to make it compatible with the regular hbase-client -->
185-
<relocation>
186-
<pattern>
187-
org.apache.hadoop.hbase.shaded.com.google.protobuf
188-
</pattern>
189-
<shadedPattern>com.google.protobuf</shadedPattern>
190-
</relocation>
191-
</relocations>
192158
</configuration>
193159
</execution>
194160
</executions>
@@ -225,7 +191,7 @@ limitations under the License.
225191
</goals>
226192
</execution>
227193
<execution>
228-
<id>verify-mirror-deps</id>
194+
<id>verify-mirror-deps-hbase</id>
229195
<phase>verify</phase>
230196
<goals>
231197
<goal>verify-mirror-deps</goal>
@@ -235,11 +201,7 @@ limitations under the License.
235201
<targetDependency>org.apache.hbase:hbase-client</targetDependency>
236202
</targetDependencies>
237203
<ignoredDependencies>
238-
<!-- Unfortunately we can't use hadoop's version of slf4j
239-
because dropwizard metrics slf4j logger requires a higher version
240-
we can't shade it either -->
241-
<dependency>org.slf4j:slf4j-api</dependency>
242-
204+
<dependency>log4j:log4j</dependency>
243205
<!-- for some reason hbase-client exposes testing deps as a compile dep, just ignore them -->
244206
<dependency>junit:junit</dependency>
245207
<dependency>org.hamcrest:hamcrest-core</dependency>

bigtable-hbase-1.x-parent/bigtable-hbase-1.x-mapreduce/pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ limitations under the License.
146146
<skip>true</skip>
147147
</configuration>
148148
</execution>
149+
<execution>
150+
<id>enforce-version-consistency-slf4j</id>
151+
<configuration>
152+
<skip>true</skip>
153+
</configuration>
154+
</execution>
149155
<!-- We are not introducing any new deps here. We expect to be
150156
running in hadoop's provided classpath -->
151157
<execution>
@@ -229,8 +235,6 @@ limitations under the License.
229235
<targetDependency>org.apache.hbase:hbase-server:${hbase1.version}</targetDependency>
230236
</targetDependencies>
231237
<ignoredDependencies>
232-
<!-- TODO: figure out why this diverges from hbase-client -->
233-
<ignoredDependency>org.slf4j:slf4j-api</ignoredDependency>
234238
<!-- For some reason, hbase-server pulls in test deps -->
235239
<ignoredDependency>junit:junit</ignoredDependency>
236240
<ignoredDependency>org.hamcrest:hamcrest-core</ignoredDependency>

0 commit comments

Comments
 (0)