Skip to content

Commit 29019ad

Browse files
deps: replace all transitive log4j deps with reload4j (#3930)
* deps: replace all transitive log4j deps with reload4j This breaks the previous assumption that bigtable-hbase doesn't change hbase's classpath. Fortunately due to the severity of the issue, all log4j deps have been removed from hbase1 and replaced with reload4j. The immediate impact is that if the enduser's application depended on log4j, there will now be duplicate log4j classes (from reload4j and the enduser's log4j) * more tweaks * more massaging * more massaging * missing reload4j dep * enforce log4j as a banned dep & remove it from another place * deal with mirroring client * oops * fix plugin scope * add logging for beam tests
1 parent 489b463 commit 29019ad

File tree

19 files changed

+221
-10
lines changed
  • bigtable-client-core-parent
  • bigtable-dataflow-parent
  • bigtable-hbase-1.x-parent
  • bigtable-hbase-2.x-parent
  • bigtable-test/bigtable-emulator-maven-plugin
  • 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-2.x-parent
      • bigtable-hbase-mirroring-client-2.x-hadoop
      • bigtable-hbase-mirroring-client-2.x
    • bigtable-hbase-mirroring-client-core-parent/bigtable-hbase-mirroring-client-core

19 files changed

+221
-10
lines changed

bigtable-client-core-parent/bigtable-hbase-integration-tests-common/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,19 @@ limitations under the License.
7272
<artifactId>hbase-shaded-testing-util</artifactId>
7373
<version>${hbase1.version}</version>
7474
<scope>test</scope>
75+
<exclusions>
76+
<exclusion>
77+
<groupId>log4j</groupId>
78+
<artifactId>log4j</artifactId>
79+
</exclusion>
80+
</exclusions>
81+
</dependency>
82+
83+
<dependency>
84+
<groupId>ch.qos.reload4j</groupId>
85+
<artifactId>reload4j</artifactId>
86+
<version>${reload4j.version}</version>
87+
<scope>runtime</scope>
7588
</dependency>
7689

7790
<dependency>

bigtable-client-core-parent/bigtable-hbase/pom.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,17 @@ limitations under the License.
168168
<version>${hbase1.version}</version>
169169
<exclusions>
170170
<exclusion>
171-
<groupId>org.slf4j</groupId>
172-
<artifactId>slf4j-log4j12</artifactId>
171+
<groupId>log4j</groupId>
172+
<artifactId>log4j</artifactId>
173173
</exclusion>
174174
</exclusions>
175175
</dependency>
176+
<dependency>
177+
<groupId>ch.qos.reload4j</groupId>
178+
<artifactId>reload4j</artifactId>
179+
<version>${reload4j.version}</version>
180+
<scope>runtime</scope>
181+
</dependency>
176182

177183
<dependency>
178184
<groupId>net.bytebuddy</groupId>

bigtable-dataflow-parent/bigtable-beam-import/pom.xml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ limitations under the License.
202202
<groupId>org.apache.hbase</groupId>
203203
<artifactId>hbase-shaded-server</artifactId>
204204
<version>${hbase1.version}</version>
205+
<exclusions>
206+
<exclusion>
207+
<groupId>log4j</groupId>
208+
<artifactId>log4j</artifactId>
209+
</exclusion>
210+
</exclusions>
205211
</dependency>
206212

207213

@@ -226,6 +232,12 @@ limitations under the License.
226232
<artifactId>commons-logging</artifactId>
227233
<version>${commons-logging.version}</version>
228234
</dependency>
235+
<dependency>
236+
<groupId>ch.qos.reload4j</groupId>
237+
<artifactId>reload4j</artifactId>
238+
<version>${reload4j.version}</version>
239+
<scope>runtime</scope>
240+
</dependency>
229241
<dependency>
230242
<groupId>org.slf4j</groupId>
231243
<artifactId>slf4j-api</artifactId>
@@ -236,9 +248,14 @@ limitations under the License.
236248
<artifactId>slf4j-log4j12</artifactId>
237249
<version>${beam-slf4j.version}</version>
238250
<scope>runtime</scope>
251+
<exclusions>
252+
<exclusion>
253+
<groupId>log4j</groupId>
254+
<artifactId>log4j</artifactId>
255+
</exclusion>
256+
</exclusions>
239257
</dependency>
240258

241-
242259
<!-- CVE Group: force update transitive deps to exclude CVEs -->
243260
<dependency>
244261
<groupId>org.apache.commons</groupId>
@@ -269,6 +286,12 @@ limitations under the License.
269286
<artifactId>hbase-shaded-testing-util</artifactId>
270287
<version>${hbase1.version}</version>
271288
<scope>test</scope>
289+
<exclusions>
290+
<exclusion>
291+
<groupId>log4j</groupId>
292+
<artifactId>log4j</artifactId>
293+
</exclusion>
294+
</exclusions>
272295
</dependency>
273296
<dependency>
274297
<groupId>junit</groupId>

bigtable-dataflow-parent/bigtable-hbase-beam/pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ limitations under the License.
9393
<groupId>org.slf4j</groupId>
9494
<artifactId>slf4j-log4j12</artifactId>
9595
</exclusion>
96+
<exclusion>
97+
<groupId>ch.qos.reload4j</groupId>
98+
<artifactId>reload4j</artifactId>
99+
</exclusion>
96100

97101
<!-- google-cloud-bigtable pulls in a newer version of this, but we want to match beam's version-->
98102
<exclusion>
@@ -137,6 +141,10 @@ limitations under the License.
137141
<groupId>org.slf4j</groupId>
138142
<artifactId>slf4j-log4j12</artifactId>
139143
</exclusion>
144+
<exclusion>
145+
<groupId>log4j</groupId>
146+
<artifactId>log4j</artifactId>
147+
</exclusion>
140148
</exclusions>
141149
</dependency>
142150

@@ -184,6 +192,12 @@ limitations under the License.
184192
<version>${junit.version}</version>
185193
<scope>test</scope>
186194
</dependency>
195+
<dependency>
196+
<groupId>ch.qos.reload4j</groupId>
197+
<artifactId>reload4j</artifactId>
198+
<version>${reload4j.version}</version>
199+
<scope>test</scope>
200+
</dependency>
187201
</dependencies>
188202

189203
<profiles>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ limitations under the License.
8585
<artifactId>commons-logging</artifactId>
8686
<version>${commons-logging.version}</version>
8787
</dependency>
88+
<dependency>
89+
<groupId>ch.qos.reload4j</groupId>
90+
<artifactId>reload4j</artifactId>
91+
<version>${reload4j.version}</version>
92+
<scope>runtime</scope>
93+
</dependency>
8894
<dependency>
8995
<groupId>io.dropwizard.metrics</groupId>
9096
<artifactId>metrics-core</artifactId>

bigtable-hbase-1.x-parent/bigtable-hbase-1.x-integration-tests/pom.xml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,6 @@ limitations under the License.
181181

182182
<dependencies>
183183
<!-- Project Modules -->
184-
<dependency>
185-
<groupId>com.google.cloud.bigtable</groupId>
186-
<artifactId>bigtable-client-core</artifactId>
187-
<version>${bigtable-client-core.version}</version>
188-
<scope>test</scope>
189-
</dependency>
190-
191184
<dependency>
192185
<groupId>com.google.cloud.bigtable</groupId>
193186
<artifactId>bigtable-hbase</artifactId>
@@ -262,6 +255,12 @@ limitations under the License.
262255
<artifactId>hbase-shaded-testing-util</artifactId>
263256
<version>${hbase1.version}</version>
264257
<scope>test</scope>
258+
<exclusions>
259+
<exclusion>
260+
<groupId>log4j</groupId>
261+
<artifactId>log4j</artifactId>
262+
</exclusion>
263+
</exclusions>
265264
</dependency>
266265

267266

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,18 @@ limitations under the License.
134134
<groupId>org.apache.hbase</groupId>
135135
<artifactId>hbase-shaded-client</artifactId>
136136
<version>${hbase1.version}</version>
137+
<exclusions>
138+
<exclusion>
139+
<groupId>log4j</groupId>
140+
<artifactId>log4j</artifactId>
141+
</exclusion>
142+
</exclusions>
143+
</dependency>
144+
<dependency>
145+
<groupId>ch.qos.reload4j</groupId>
146+
<artifactId>reload4j</artifactId>
147+
<version>${reload4j.version}</version>
148+
<scope>runtime</scope>
137149
</dependency>
138150

139151
<dependency>
@@ -228,6 +240,7 @@ limitations under the License.
228240
<!-- exclude user visible deps -->
229241
<exclude>io.dropwizard.metrics:metrics-core</exclude>
230242
<exclude>commons-logging:commons-logging</exclude>
243+
<exclude>ch.qos.reload4j:reload4j</exclude>
231244
<!-- exclude hbase-shaded-client & all of its dependencies -->
232245
<exclude>org.apache.hbase:hbase-shaded-client</exclude>
233246
<exclude>org.slf4j:slf4j-api</exclude>
@@ -430,6 +443,9 @@ limitations under the License.
430443
<targetDependencies>
431444
<targetDependency>org.apache.hbase:hbase-shaded-client</targetDependency>
432445
</targetDependencies>
446+
<ignoredDependencies>
447+
<ignoredDependency>log4j:log4j</ignoredDependency>
448+
</ignoredDependencies>
433449
</configuration>
434450
</execution>
435451
</executions>

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ limitations under the License.
7474
<groupId>org.apache.hbase</groupId>
7575
<artifactId>hbase-shaded-client</artifactId>
7676
<version>${hbase1.version}</version>
77+
<exclusions>
78+
<exclusion>
79+
<groupId>log4j</groupId>
80+
<artifactId>log4j</artifactId>
81+
</exclusion>
82+
</exclusions>
83+
</dependency>
84+
<dependency>
85+
<groupId>ch.qos.reload4j</groupId>
86+
<artifactId>reload4j</artifactId>
87+
<version>${reload4j.version}</version>
88+
<scope>runtime</scope>
7789
</dependency>
7890

7991
<dependency>

bigtable-hbase-2.x-parent/bigtable-hbase-2.x-integration-tests/pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,18 @@ limitations under the License.
248248
<groupId>org.slf4j</groupId>
249249
<artifactId>slf4j-api</artifactId>
250250
</exclusion>
251+
<exclusion>
252+
<groupId>log4j</groupId>
253+
<artifactId>log4j</artifactId>
254+
</exclusion>
251255
</exclusions>
252256
</dependency>
257+
<dependency>
258+
<groupId>ch.qos.reload4j</groupId>
259+
<artifactId>reload4j</artifactId>
260+
<version>${reload4j.version}</version>
261+
<scope>runtime</scope>
262+
</dependency>
253263

254264
<!-- Misc -->
255265
<dependency>
@@ -283,6 +293,12 @@ limitations under the License.
283293
<groupId>org.slf4j</groupId>
284294
<artifactId>slf4j-log4j12</artifactId>
285295
<version>${slf4j.version}</version>
296+
<exclusions>
297+
<exclusion>
298+
<groupId>log4j</groupId>
299+
<artifactId>log4j</artifactId>
300+
</exclusion>
301+
</exclusions>
286302
<scope>test</scope>
287303
</dependency>
288304

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ limitations under the License.
228228
<exclude>org.slf4j:slf4j-api</exclude>
229229
<exclude>org.slf4j:slf4j-log4j12</exclude>
230230
<exclude>log4j:log4j</exclude>
231+
<exclude>ch.qos.reload4j:reload4j</exclude>
231232
<exclude>org.apache.htrace:htrace-core4</exclude>
232233
<exclude>org.apache.yetus:audience-annotations</exclude>
233234
<exclude>

0 commit comments

Comments
 (0)