From 8f9a4199238a696f10d92a2e4f0f79c83f034e35 Mon Sep 17 00:00:00 2001 From: Leonid Andreev Date: Thu, 27 Jan 2022 15:05:23 -0500 Subject: [PATCH 1/3] After some experimenting, a relatively simple (?) way to ensure we no longer include log4j-1.* in the war file. (IQSS/dataverse-security#48; also #8372) --- pom.xml | 50 +++++++++++++++++-- .../iq/dataverse/EjbDataverseEngine.java | 2 +- .../iq/dataverse/util/bagit/OREMap.java | 2 +- 3 files changed, 49 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index bf484ad041d..97735a60700 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,8 @@ 5.2021.5 42.2.19 1.11.762 - 1.7.32 + 1.7.35 + 1.2.18.4 2.11.0 1.2 3.12.0 @@ -225,9 +226,13 @@ + + + + org.slf4j - slf4j-log4j12 + slf4j-reload4j ${slf4j.version} @@ -235,6 +240,11 @@ jcl-over-slf4j ${slf4j.version} + + org.slf4j + jul-to-slf4j + ${slf4j.version} + @@ -252,7 +262,25 @@ org.slf4j slf4j-jdk14 - + + org.slf4j + slf4j-api + + + org.slf4j + jcl-over-slf4j + + + org.slf4j + jul-to-slf4j + + + + + ch.qos.reload4j + reload4j + ${reload4j.version} + org.passay passay @@ -573,6 +601,10 @@ + + + + com.lyncode xoai-common @@ -582,11 +614,23 @@ com.lyncode xoai-data-provider 4.1.0-header-patch + + + log4j + log4j + + com.lyncode xoai-service-provider 4.1.0-header-patch + + + log4j + log4j + + diff --git a/src/main/java/edu/harvard/iq/dataverse/EjbDataverseEngine.java b/src/main/java/edu/harvard/iq/dataverse/EjbDataverseEngine.java index 32f01d112ee..1c78ba08479 100644 --- a/src/main/java/edu/harvard/iq/dataverse/EjbDataverseEngine.java +++ b/src/main/java/edu/harvard/iq/dataverse/EjbDataverseEngine.java @@ -51,7 +51,7 @@ import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolationException; -import org.apache.log4j.lf5.LogLevel; +//import org.apache.log4j.lf5.LogLevel; /** * An EJB capable of executing {@link Command}s in a JEE environment. diff --git a/src/main/java/edu/harvard/iq/dataverse/util/bagit/OREMap.java b/src/main/java/edu/harvard/iq/dataverse/util/bagit/OREMap.java index 0b7befe0f94..37d8f3b7217 100644 --- a/src/main/java/edu/harvard/iq/dataverse/util/bagit/OREMap.java +++ b/src/main/java/edu/harvard/iq/dataverse/util/bagit/OREMap.java @@ -35,7 +35,7 @@ import javax.json.JsonValue; import org.apache.commons.lang3.exception.ExceptionUtils; -import org.apache.log4j.lf5.LogLevel; +//import org.apache.log4j.lf5.LogLevel; public class OREMap { From aae7bbb955ec410395944962783f49667f266ab7 Mon Sep 17 00:00:00 2001 From: Leonid Andreev Date: Mon, 31 Jan 2022 10:55:08 -0500 Subject: [PATCH 2/3] cleanup of the log4j elimination project. (#IQSS/dataverse-security/48). --- pom.xml | 58 ++++++------------- .../iq/dataverse/EjbDataverseEngine.java | 2 - .../iq/dataverse/util/bagit/OREMap.java | 1 - 3 files changed, 19 insertions(+), 42 deletions(-) diff --git a/pom.xml b/pom.xml index 97735a60700..d2237d700b7 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ 42.2.19 1.11.762 1.7.35 - 1.2.18.4 + 1.2.18.4 2.11.0 1.2 3.12.0 @@ -224,17 +224,6 @@ slf4j-jdk14 ${slf4j.version} - - - - - - - org.slf4j - slf4j-reload4j - ${slf4j.version} - org.slf4j jcl-over-slf4j @@ -262,26 +251,8 @@ org.slf4j slf4j-jdk14 + - org.slf4j - slf4j-api - - - org.slf4j - jcl-over-slf4j - - - org.slf4j - jul-to-slf4j - - - - - ch.qos.reload4j - reload4j - ${reload4j.version} - - org.passay passay 1.6.0 @@ -601,10 +572,11 @@ - - - - + + + + + com.lyncode xoai-common @@ -614,10 +586,10 @@ com.lyncode xoai-data-provider 4.1.0-header-patch - + - log4j - log4j + log4j + log4j @@ -625,13 +597,21 @@ com.lyncode xoai-service-provider 4.1.0-header-patch - + log4j log4j + + + + + ch.qos.reload4j + reload4j + ${reload4j.version} + com.google.auto.service diff --git a/src/main/java/edu/harvard/iq/dataverse/EjbDataverseEngine.java b/src/main/java/edu/harvard/iq/dataverse/EjbDataverseEngine.java index 1c78ba08479..b4efe7ec41d 100644 --- a/src/main/java/edu/harvard/iq/dataverse/EjbDataverseEngine.java +++ b/src/main/java/edu/harvard/iq/dataverse/EjbDataverseEngine.java @@ -51,8 +51,6 @@ import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolationException; -//import org.apache.log4j.lf5.LogLevel; - /** * An EJB capable of executing {@link Command}s in a JEE environment. * diff --git a/src/main/java/edu/harvard/iq/dataverse/util/bagit/OREMap.java b/src/main/java/edu/harvard/iq/dataverse/util/bagit/OREMap.java index 37d8f3b7217..8d5aceea3ca 100644 --- a/src/main/java/edu/harvard/iq/dataverse/util/bagit/OREMap.java +++ b/src/main/java/edu/harvard/iq/dataverse/util/bagit/OREMap.java @@ -35,7 +35,6 @@ import javax.json.JsonValue; import org.apache.commons.lang3.exception.ExceptionUtils; -//import org.apache.log4j.lf5.LogLevel; public class OREMap { From 790fe1f95d45e9847e744c559ce3a9f1b461682c Mon Sep 17 00:00:00 2001 From: Leonid Andreev Date: Tue, 1 Feb 2022 17:35:43 -0500 Subject: [PATCH 3/3] OK, adding an explicit anti-log4j rule to checkstyle.xml, why not. (#IQSS/dataverse-security/48) --- checkstyle.xml | 2 +- .../dataverse/harvest/server/xoai/XdataProvider.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/checkstyle.xml b/checkstyle.xml index 99185e15e97..c00fa3a8c0c 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -98,7 +98,7 @@ --> - +