Skip to content

Commit d32e540

Browse files
deps: unflatten 2x hadoop & shaded artifact deps (#4226)
Change-Id: Iff035fa787814d9f297d9cd69706d8f12ac27ac8 Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigtable-hbase/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> ☕️ If you write sample code, please follow the [samples format]( https://togithub.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md).
1 parent 194d061 commit d32e540

File tree

2 files changed

+97
-210
lines changed
  • bigtable-hbase-2.x-parent

2 files changed

+97
-210
lines changed

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

Lines changed: 40 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,17 @@ limitations under the License.
3030
bigtable-hbase-2.x.
3131
</description>
3232

33-
<properties>
34-
<!-- define a property that can be ignored by renovate -->
35-
<hbase2-hadoop-slf4j.version>1.7.30</hbase2-hadoop-slf4j.version>
36-
</properties>
37-
3833
<dependencies>
3934
<dependency>
4035
<groupId>${project.groupId}</groupId>
4136
<artifactId>bigtable-hbase-2.x-shaded</artifactId>
4237
<version>2.12.1-SNAPSHOT</version> <!-- {x-version-update:bigtable-client-parent:current} -->
4338
<exclusions>
39+
<!-- hbase-shaded-client will be replaced with hbase-client -->
4440
<exclusion>
4541
<groupId>org.apache.hbase</groupId>
4642
<artifactId>hbase-shaded-client</artifactId>
4743
</exclusion>
48-
<exclusion>
49-
<groupId>com.google.code.findbugs</groupId>
50-
<artifactId>jsr305</artifactId>
51-
</exclusion>
5244

5345
<!-- Workaround MNG-5899 & MSHADE-206. Maven >= 3.3.0 doesn't use the dependency reduced
5446
pom.xml files when invoking the build from a parent project. So we have to manually exclude
@@ -58,6 +50,7 @@ limitations under the License.
5850
<groupId>${project.groupId}</groupId>
5951
<artifactId>bigtable-hbase-2.x</artifactId>
6052
</exclusion>
53+
<!-- TODO: remove this exclusion -->
6154
<exclusion>
6255
<groupId>com.google.cloud.bigtable</groupId>
6356
<artifactId>bigtable-metrics-api</artifactId>
@@ -72,29 +65,13 @@ limitations under the License.
7265
</exclusion>
7366
</exclusions>
7467
</dependency>
68+
7569
<dependency>
7670
<groupId>org.apache.hbase</groupId>
7771
<artifactId>hbase-client</artifactId>
7872
<version>${hbase2.version}</version>
7973
</dependency>
8074

81-
<!-- Manually promote dependencies: This is necessary to avoid flattening hbase-shaded-client's dependency tree -->
82-
<dependency>
83-
<groupId>commons-logging</groupId>
84-
<artifactId>commons-logging</artifactId>
85-
<version>${commons-logging.version}</version>
86-
</dependency>
87-
88-
<!-- unlike hbase-shaded-client, hbase-client depends on slf4j 1.6.1.
89-
Which is older than the version requested by metrics-core. However,
90-
metrics-core will work fine with the older version and we want to stay
91-
compatible with hbase-client deps -->
92-
<dependency>
93-
<groupId>org.slf4j</groupId>
94-
<artifactId>slf4j-api</artifactId>
95-
<version>${hbase2-hadoop-slf4j.version}</version>
96-
</dependency>
97-
9875
<!-- Test deps -->
9976
<dependency>
10077
<groupId>junit</groupId>
@@ -105,40 +82,37 @@ limitations under the License.
10582
</dependencies>
10683

10784
<build>
85+
<pluginManagement>
86+
<plugins>
87+
<plugin>
88+
<groupId>org.apache.maven.plugins</groupId>
89+
<artifactId>maven-enforcer-plugin</artifactId>
90+
<executions>
91+
<execution>
92+
<id>enforce</id>
93+
<!-- requireUpperBoundDeps, banDuplicateClasses -->
94+
<configuration>
95+
<skip>true</skip>
96+
</configuration>
97+
</execution>
98+
<execution>
99+
<id>enforce-banned-deps</id>
100+
<configuration>
101+
<skip>true</skip>
102+
</configuration>
103+
</execution>
104+
<execution>
105+
<id>enforce-version-consistency-slf4j</id>
106+
<configuration>
107+
<skip>true</skip>
108+
</configuration>
109+
</execution>
110+
</executions>
111+
</plugin>
112+
</plugins>
113+
</pluginManagement>
114+
108115
<plugins>
109-
<plugin>
110-
<!-- disable google-cloud-shared-config enforcement checks because
111-
hbase-client's dependency subtree doesn't follow the same rules and is
112-
unable to be fixed here -->
113-
<groupId>org.apache.maven.plugins</groupId>
114-
<artifactId>maven-enforcer-plugin</artifactId>
115-
<executions>
116-
<execution>
117-
<id>enforce</id>
118-
<configuration>
119-
<skip>true</skip>
120-
</configuration>
121-
</execution>
122-
<!-- hbase-client doesnt align slf4j-api & slf4j-log4j -->
123-
<execution>
124-
<id>enforce-version-consistency-slf4j</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>
142116
<plugin>
143117
<groupId>org.apache.maven.plugins</groupId>
144118
<artifactId>maven-shade-plugin</artifactId>
@@ -152,14 +126,10 @@ limitations under the License.
152126
<shadedArtifactAttached>false</shadedArtifactAttached>
153127
<createDependencyReducedPom>true</createDependencyReducedPom>
154128
<!-- Need to manually promote to dependencies to keep the structure of hbase-shade-client -->
155-
<promoteTransitiveDependencies>
156-
false
157-
</promoteTransitiveDependencies>
129+
<promoteTransitiveDependencies>false</promoteTransitiveDependencies>
158130
<transformers>
159-
<transformer
160-
implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
161-
<transformer
162-
implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"/>
131+
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
132+
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"/>
163133
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
164134
</transformers>
165135
<filters>
@@ -174,20 +144,9 @@ limitations under the License.
174144
</filters>
175145
<artifactSet>
176146
<includes>
177-
<include>
178-
com.google.cloud.bigtable:bigtable-hbase-2.x-shaded
179-
</include>
147+
<include>com.google.cloud.bigtable:bigtable-hbase-2.x-shaded</include>
180148
</includes>
181149
</artifactSet>
182-
<relocations>
183-
<!-- Undo the relocation that hbase-shaded-client did to make it compatible with the regular hbase-client -->
184-
<relocation>
185-
<pattern>
186-
org.apache.hadoop.hbase.shaded.com.google.protobuf
187-
</pattern>
188-
<shadedPattern>com.google.protobuf</shadedPattern>
189-
</relocation>
190-
</relocations>
191150
</configuration>
192151
</execution>
193152
</executions>
@@ -226,20 +185,17 @@ limitations under the License.
226185
</goals>
227186
</execution>
228187
<execution>
229-
<id>verify-mirror-deps</id>
188+
<id>verify-mirror-deps-hbase</id>
230189
<phase>verify</phase>
231190
<goals>
232191
<goal>verify-mirror-deps</goal>
233192
</goals>
234193
<configuration>
235194
<targetDependencies>
236-
<targetDependency>org.apache.hbase:hbase-client:${hbase2.version}</targetDependency>
195+
<targetDependency>org.apache.hbase:hbase-client</targetDependency>
237196
</targetDependencies>
238197
<ignoredDependencies>
239-
<!-- There are 3 users of this dep: us, httpclient & hbase2.
240-
httpclient requires a higher version than hbase, so for now,
241-
we are using that version -->
242-
<ignoredDependency>commons-logging:commons-logging</ignoredDependency>
198+
<dependency>log4j:log4j</dependency>
243199
</ignoredDependencies>
244200
</configuration>
245201
</execution>

0 commit comments

Comments
 (0)