Skip to content

Commit 6106fbc

Browse files
authored
[BEAM-13434] Pin transitive log4j dependencies to 2.17.0 in ...:hcatalog modules. #16302
2 parents af05662 + 2bb9eb3 commit 6106fbc

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

sdks/java/extensions/sql/hcatalog/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@ applyJavaNature(
2828
def hive_version = "2.1.0"
2929
def netty_version = "4.1.51.Final"
3030

31+
configurations.all {
32+
resolutionStrategy {
33+
// Pin log4j as workaround for CVE-2021-44228
34+
// HIVE-25804 should address this upstream, but only in 4.0
35+
// TODO(BEAM-9351): Upgrade Hive and remove this pin
36+
def log4j_version = "2.17.0"
37+
force "org.apache.logging.log4j:log4j-api:${log4j_version}"
38+
force "org.apache.logging.log4j:log4j-core:${log4j_version}"
39+
force "org.apache.logging.log4j:log4j-slf4j-impl:${log4j_version}"
40+
force "org.apache.logging.log4j:log4j-1.2-api:${log4j_version}"
41+
force "org.apache.logging.log4j:log4j-web:${log4j_version}"
42+
}
43+
}
44+
3145
dependencies {
3246
provided project(":sdks:java:extensions:sql")
3347
provided project(":sdks:java:io:hcatalog")

sdks/java/io/hcatalog/build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ test {
4141
ignoreFailures true
4242
}
4343

44-
configurations.testRuntimeClasspath {
44+
configurations.all {
4545
resolutionStrategy {
46-
def log4j_version = "2.16.0"
47-
// Beam's build system forces a uniform log4j version resolution for all modules, however for
48-
// the HCatalog case the current version of log4j produces NoClassDefFoundError so we need to
49-
// force an old version on the tests runtime classpath
46+
// Pin log4j as workaround for CVE-2021-44228
47+
// HIVE-25804 should address this upstream, but only in 4.0
48+
// TODO(BEAM-9351): Upgrade Hive and remove this pin
49+
def log4j_version = "2.17.0"
5050
force "org.apache.logging.log4j:log4j-api:${log4j_version}"
5151
force "org.apache.logging.log4j:log4j-core:${log4j_version}"
52+
force "org.apache.logging.log4j:log4j-slf4j-impl:${log4j_version}"
53+
force "org.apache.logging.log4j:log4j-1.2-api:${log4j_version}"
54+
force "org.apache.logging.log4j:log4j-web:${log4j_version}"
5255
}
5356
}
5457

0 commit comments

Comments
 (0)