Skip to content

Commit ce9e53b

Browse files
deps: clean up mirroring client deps (#4261)
* add IDE workaround for mirroring-client shaded deps to be resolved from ~/.m2 * drop shading from intermediate artifacts * organize mirroring client poms so that env deps come first * update mirroring client integration tests to avoid duplicated classes from hbase-shaded-client and hbase-shaded-testing-util * use reload4j for integration test logging * add google-cloud-bigtable as a dep to integration test modules to resolve conflict about guava * update integration test modules to exclude transitive deps from each other to make easier to reason about the classpath Change-Id: I0a9c57ac5eac609847cb28014c156436fb94abe2
1 parent 781d586 commit ce9e53b

File tree

13 files changed

+356
-339
lines changed
  • hbase-migration-tools/mirroring-client
    • bigtable-hbase-mirroring-client-1.x-parent
      • bigtable-hbase-mirroring-client-1.x-hadoop
      • bigtable-hbase-mirroring-client-1.x-integration-tests
      • bigtable-hbase-mirroring-client-1.x-shaded
      • bigtable-hbase-mirroring-client-1.x
    • bigtable-hbase-mirroring-client-2.x-parent
      • bigtable-hbase-mirroring-client-1.x-2.x-integration-tests
      • bigtable-hbase-mirroring-client-2.x-hadoop
      • bigtable-hbase-mirroring-client-2.x-integration-tests
      • bigtable-hbase-mirroring-client-2.x-shaded
      • bigtable-hbase-mirroring-client-2.x
    • bigtable-hbase-mirroring-client-core-parent

13 files changed

+356
-339
lines changed

hbase-migration-tools/mirroring-client/bigtable-hbase-mirroring-client-1.x-parent/bigtable-hbase-mirroring-client-1.x-hadoop/pom.xml

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,25 @@ limitations under the License.
3939
</properties>
4040

4141
<dependencies>
42+
<!-- Environment deps first -->
43+
<dependency>
44+
<groupId>org.apache.hbase</groupId>
45+
<artifactId>hbase-client</artifactId>
46+
<version>${hbase1.version}</version>
47+
<exclusions>
48+
<exclusion>
49+
<groupId>log4j</groupId>
50+
<artifactId>log4j</artifactId>
51+
</exclusion>
52+
</exclusions>
53+
</dependency>
54+
<dependency>
55+
<groupId>ch.qos.reload4j</groupId>
56+
<artifactId>reload4j</artifactId>
57+
<version>${reload4j.version}</version>
58+
<scope>runtime</scope>
59+
</dependency>
60+
4261
<!-- Internal dependencies that will be shaded along with their transitive dependencies. -->
4362
<dependency>
4463
<groupId>com.google.cloud.bigtable</groupId>
@@ -60,31 +79,8 @@ limitations under the License.
6079
<groupId>${project.groupId}</groupId>
6180
<artifactId>bigtable-hbase-mirroring-client-1.x</artifactId>
6281
</exclusion>
63-
<exclusion>
64-
<groupId>io.opencensus</groupId>
65-
<artifactId>*</artifactId>
66-
</exclusion>
6782
</exclusions>
6883
</dependency>
69-
70-
<!-- Manually promote public dependencies: This is necessary to avoid flattening hbase-shaded-client's dependency tree -->
71-
<dependency>
72-
<groupId>org.apache.hbase</groupId>
73-
<artifactId>hbase-client</artifactId>
74-
<version>${hbase1.version}</version>
75-
<exclusions>
76-
<exclusion>
77-
<groupId>log4j</groupId>
78-
<artifactId>log4j</artifactId>
79-
</exclusion>
80-
</exclusions>
81-
</dependency>
82-
<dependency>
83-
<groupId>ch.qos.reload4j</groupId>
84-
<artifactId>reload4j</artifactId>
85-
<version>${reload4j.version}</version>
86-
<scope>runtime</scope>
87-
</dependency>
8884
</dependencies>
8985

9086
<build>
@@ -147,9 +143,6 @@ limitations under the License.
147143
<include>
148144
com.google.cloud.bigtable:bigtable-hbase-mirroring-client-1.x-shaded
149145
</include>
150-
<include>
151-
com.google.cloud.bigtable:bigtable-hbase-mirroring-client-1.x
152-
</include>
153146
</includes>
154147
</artifactSet>
155148
<relocations>

hbase-migration-tools/mirroring-client/bigtable-hbase-mirroring-client-1.x-parent/bigtable-hbase-mirroring-client-1.x-integration-tests/pom.xml

Lines changed: 46 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -178,29 +178,13 @@ limitations under the License.
178178
</profiles>
179179

180180
<dependencies>
181-
<dependency>
182-
<groupId>com.google.cloud.bigtable</groupId>
183-
<artifactId>bigtable-hbase-mirroring-client-1.x</artifactId>
184-
<version>0.7.1-SNAPSHOT</version> <!-- {x-version-update:bigtable-hbase-mirroring:current} -->
185-
<scope>test</scope>
186-
</dependency>
187-
181+
<!-- Environment deps first -->
188182
<dependency>
189183
<groupId>org.apache.hbase</groupId>
190-
<artifactId>hbase-shaded-client</artifactId>
184+
<artifactId>hbase-shaded-testing-util</artifactId>
191185
<version>${hbase1.version}</version>
192186
<scope>test</scope>
193187
<exclusions>
194-
<!-- exclusion to avoid version conflict with existing artifact -->
195-
<exclusion>
196-
<groupId>org.slf4j</groupId>
197-
<artifactId>slf4j-api</artifactId>
198-
</exclusion>
199-
<!-- exclusion to avoid version conflict with existing artifact -->
200-
<exclusion>
201-
<groupId>org.slf4j</groupId>
202-
<artifactId>slf4j-log4j12</artifactId>
203-
</exclusion>
204188
<exclusion>
205189
<groupId>log4j</groupId>
206190
<artifactId>log4j</artifactId>
@@ -211,48 +195,64 @@ limitations under the License.
211195
<groupId>ch.qos.reload4j</groupId>
212196
<artifactId>reload4j</artifactId>
213197
<version>${reload4j.version}</version>
214-
<scope>runtime</scope>
198+
<scope>test</scope>
215199
</dependency>
216200

201+
<!-- Project Modules -->
217202
<dependency>
218-
<groupId>${project.groupId}</groupId>
219-
<artifactId>bigtable-hbase-1.x-hadoop</artifactId>
220-
<version>2.12.1-SNAPSHOT</version> <!-- {x-version-update:bigtable-client-parent:current} -->
203+
<groupId>com.google.cloud.bigtable</groupId>
204+
<artifactId>bigtable-hbase-mirroring-client-1.x</artifactId>
205+
<version>0.7.1-SNAPSHOT</version> <!-- {x-version-update:bigtable-hbase-mirroring:current} -->
221206
<scope>test</scope>
207+
<exclusions>
208+
<exclusion>
209+
<groupId>org.apache.hbase</groupId>
210+
<artifactId>hbase-shaded-client</artifactId>
211+
</exclusion>
212+
</exclusions>
222213
</dependency>
223214

224-
<!-- HBase testing tools -->
225215
<dependency>
226-
<groupId>org.apache.hbase</groupId>
227-
<artifactId>hbase-shaded-testing-util</artifactId>
228-
<version>${hbase1.version}</version>
216+
<groupId>${project.groupId}</groupId>
217+
<artifactId>bigtable-hbase-1.x</artifactId>
218+
<version>2.12.1-SNAPSHOT</version> <!-- {x-version-update:bigtable-client-parent:current} -->
229219
<scope>test</scope>
230220
<exclusions>
231-
<!-- exclusion to avoid version conflict with existing artifact -->
232-
<exclusion>
233-
<groupId>org.slf4j</groupId>
234-
<artifactId>slf4j-api</artifactId>
235-
</exclusion>
236-
<!-- exclusion to avoid version conflict with existing artifact -->
221+
<!-- already included in the hbase-shaded-testing-util -->
237222
<exclusion>
238-
<groupId>org.slf4j</groupId>
239-
<artifactId>slf4j-log4j12</artifactId>
240-
</exclusion>
241-
<exclusion>
242-
<groupId>log4j</groupId>
243-
<artifactId>log4j</artifactId>
223+
<groupId>org.apache.hbase</groupId>
224+
<artifactId>hbase-shaded-client</artifactId>
244225
</exclusion>
245226
</exclusions>
246227
</dependency>
247228

248-
<!-- Misc -->
229+
<!-- This gets pulled in by bigtable-hbase-1.x.
230+
Add ths to resolve conflict with the guava version that opencensus-exporter-trace-zipkin pulls in -->
231+
<dependency>
232+
<groupId>com.google.cloud</groupId>
233+
<artifactId>google-cloud-bigtable</artifactId>
234+
<version>${bigtable.version}</version>
235+
<scope>test</scope>
236+
</dependency>
237+
238+
239+
<!-- Internal testing utils -->
249240
<dependency>
250-
<groupId>com.google.protobuf</groupId>
251-
<artifactId>protobuf-java</artifactId>
252-
<version>3.22.2</version>
241+
<groupId>com.google.cloud.bigtable</groupId>
242+
<artifactId>bigtable-hbase-mirroring-client-core</artifactId>
243+
<version>0.7.1-SNAPSHOT</version> <!-- {x-version-update:bigtable-hbase-mirroring:current} -->
244+
<type>test-jar</type>
253245
<scope>test</scope>
246+
<exclusions>
247+
<!-- Only want test helpers -->
248+
<exclusion>
249+
<groupId>*</groupId>
250+
<artifactId>*</artifactId>
251+
</exclusion>
252+
</exclusions>
254253
</dependency>
255254

255+
<!-- Misc -->
256256
<dependency>
257257
<groupId>commons-lang</groupId>
258258
<artifactId>commons-lang</artifactId>
@@ -264,22 +264,26 @@ limitations under the License.
264264
<groupId>io.opencensus</groupId>
265265
<artifactId>opencensus-impl</artifactId>
266266
<version>${opencensus.version}</version>
267+
<scope>test</scope>
267268
</dependency>
268269
<dependency>
269270
<groupId>io.opencensus</groupId>
270271
<artifactId>opencensus-exporter-trace-zipkin</artifactId>
271272
<version>${opencensus.version}</version>
273+
<scope>test</scope>
272274
</dependency>
273275
<dependency>
274276
<groupId>io.opencensus</groupId>
275277
<artifactId>opencensus-exporter-stats-prometheus</artifactId>
276278
<version>${opencensus.version}</version>
279+
<scope>test</scope>
277280
</dependency>
278281
<dependency>
279282
<groupId>io.prometheus</groupId>
280283
<artifactId>simpleclient_httpserver</artifactId>
281284
<!-- Should match prometheus version used by opencensus-exporter-stats-prometheus -->
282285
<version>0.6.0</version>
286+
<scope>test</scope>
283287
</dependency>
284288

285289
<!-- Testing deps -->
@@ -302,25 +306,6 @@ limitations under the License.
302306
<version>${mockito.version}</version>
303307
<scope>test</scope>
304308
</dependency>
305-
<dependency>
306-
<groupId>org.apache.logging.log4j</groupId>
307-
<artifactId>log4j-api</artifactId>
308-
<version>2.20.0</version>
309-
<scope>test</scope>
310-
</dependency>
311-
<dependency>
312-
<groupId>org.apache.logging.log4j</groupId>
313-
<artifactId>log4j-core</artifactId>
314-
<version>2.20.0</version>
315-
<scope>test</scope>
316-
</dependency>
317-
<dependency>
318-
<groupId>com.google.cloud.bigtable</groupId>
319-
<artifactId>bigtable-hbase-mirroring-client-core</artifactId>
320-
<version>0.7.1-SNAPSHOT</version> <!-- {x-version-update:bigtable-hbase-mirroring:current} -->
321-
<type>test-jar</type>
322-
<scope>test</scope>
323-
</dependency>
324309
</dependencies>
325310

326311
<build>

hbase-migration-tools/mirroring-client/bigtable-hbase-mirroring-client-1.x-parent/bigtable-hbase-mirroring-client-1.x-shaded/pom.xml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,7 @@ limitations under the License.
3535
</description>
3636

3737
<dependencies>
38-
<!-- Internal dependencies that will be shaded along with their transitive dependencies. -->
39-
<dependency>
40-
<groupId>com.google.cloud.bigtable</groupId>
41-
<artifactId>bigtable-hbase-mirroring-client-1.x</artifactId>
42-
<version>0.7.1-SNAPSHOT</version> <!-- {x-version-update:bigtable-hbase-mirroring:current} -->
43-
<scope>compile</scope>
44-
</dependency>
45-
46-
<!-- Manually promote public dependencies: This is necessary to avoid flattening hbase-shaded-client's dependency tree -->
38+
<!-- Environment deps first -->
4739
<dependency>
4840
<groupId>org.apache.hbase</groupId>
4941
<artifactId>hbase-shaded-client</artifactId>
@@ -60,6 +52,14 @@ limitations under the License.
6052
<artifactId>reload4j</artifactId>
6153
<version>${reload4j.version}</version>
6254
</dependency>
55+
56+
<!-- Internal dependencies that will be shaded along with their transitive dependencies. -->
57+
<dependency>
58+
<groupId>com.google.cloud.bigtable</groupId>
59+
<artifactId>bigtable-hbase-mirroring-client-1.x</artifactId>
60+
<version>0.7.1-SNAPSHOT</version> <!-- {x-version-update:bigtable-hbase-mirroring:current} -->
61+
<scope>compile</scope>
62+
</dependency>
6363
</dependencies>
6464

6565
<build>
@@ -100,18 +100,17 @@ limitations under the License.
100100
</transformers>
101101
<artifactSet>
102102
<excludes>
103-
<!-- exclude user visible deps -->
104-
<exclude>commons-logging:commons-logging</exclude>
105103
<!-- exclude hbase-shaded-client & all of its dependencies -->
106104
<exclude>org.apache.hbase:hbase-shaded-client</exclude>
105+
<exclude>commons-logging:commons-logging</exclude>
107106
<exclude>org.slf4j:slf4j-api</exclude>
108-
<exclude>org.slf4j:slf4j-log4j12</exclude>
109-
<exclude>log4j:log4j</exclude>
110-
<exclude>ch.qos.reload4j:reload4j</exclude>
111-
<exclude>org.apache.htrace:htrace-core4</exclude>
112-
<exclude>org.apache.htrace:htrace-core</exclude>
113107
<exclude>com.github.stephenc.findbugs:findbugs-annotations</exclude>
108+
<exclude>org.apache.htrace:htrace-core4</exclude>
114109
<exclude>log4j:log4j</exclude>
110+
<exclude>org.apache.htrace:htrace-core</exclude>
111+
<exclude>org.slf4j:slf4j-log4j12</exclude>
112+
<!-- Exclude reload4j -->
113+
<exclude>ch.qos.reload4j:reload4j</exclude>
115114
</excludes>
116115
</artifactSet>
117116
<relocations>

hbase-migration-tools/mirroring-client/bigtable-hbase-mirroring-client-1.x-parent/bigtable-hbase-mirroring-client-1.x/pom.xml

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,46 @@ limitations under the License.
3434
</description>
3535

3636
<dependencies>
37+
<!-- Environment deps first -->
38+
<dependency>
39+
<groupId>org.apache.hbase</groupId>
40+
<artifactId>hbase-shaded-client</artifactId>
41+
<version>${hbase1.version}</version>
42+
<exclusions>
43+
<exclusion>
44+
<groupId>log4j</groupId>
45+
<artifactId>log4j</artifactId>
46+
</exclusion>
47+
</exclusions>
48+
</dependency>
49+
<dependency>
50+
<groupId>ch.qos.reload4j</groupId>
51+
<artifactId>reload4j</artifactId>
52+
<version>${reload4j.version}</version>
53+
<scope>runtime</scope>
54+
</dependency>
55+
56+
<!-- Project deps -->
3757
<dependency>
3858
<groupId>com.google.cloud.bigtable</groupId>
3959
<artifactId>bigtable-hbase-mirroring-client-core</artifactId>
4060
<version>0.7.1-SNAPSHOT</version> <!-- {x-version-update:bigtable-hbase-mirroring:current} -->
4161
<scope>compile</scope>
62+
63+
<exclusions>
64+
<!-- Exclude the environment deps, as they are declared explicitly above -->
65+
<exclusion>
66+
<groupId>org.apache.hbase</groupId>
67+
<artifactId>hbase-shaded-client</artifactId>
68+
</exclusion>
69+
<exclusion>
70+
<groupId>ch.qos.reload4j</groupId>
71+
<artifactId>reload4j</artifactId>
72+
</exclusion>
73+
</exclusions>
4274
</dependency>
4375

44-
<!-- Test deps -->
76+
<!-- Test dependencies -->
4577
<dependency>
4678
<groupId>junit</groupId>
4779
<artifactId>junit</artifactId>
@@ -66,6 +98,13 @@ limitations under the License.
6698
<version>0.7.1-SNAPSHOT</version> <!-- {x-version-update:bigtable-hbase-mirroring:current} -->
6799
<type>test-jar</type>
68100
<scope>test</scope>
101+
<exclusions>
102+
<!-- We only want the test helpers -->
103+
<exclusion>
104+
<groupId>*</groupId>
105+
<artifactId>*</artifactId>
106+
</exclusion>
107+
</exclusions>
69108
</dependency>
70109
</dependencies>
71110

@@ -96,30 +135,6 @@ limitations under the License.
96135
</execution>
97136
</executions>
98137
</plugin>
99-
100-
<!-- copy protobuf-java-format-shaded and core into jar -->
101-
<plugin>
102-
<groupId>org.apache.maven.plugins</groupId>
103-
<artifactId>maven-shade-plugin</artifactId>
104-
<executions>
105-
<execution>
106-
<phase>package</phase>
107-
<goals>
108-
<goal>shade</goal>
109-
</goals>
110-
<configuration>
111-
<shadedArtifactAttached>false</shadedArtifactAttached>
112-
<createDependencyReducedPom>true</createDependencyReducedPom>
113-
<artifactSet>
114-
<includes>
115-
<include>com.google.cloud.bigtable:protobuf-java-format-shaded</include>
116-
<include>com.google.cloud.bigtable}:bigtable-hbase-mirroring-client-core</include>
117-
</includes>
118-
</artifactSet>
119-
</configuration>
120-
</execution>
121-
</executions>
122-
</plugin>
123138
</plugins>
124139
</build>
125140
</project>

0 commit comments

Comments
 (0)