Skip to content

Commit d7d58ef

Browse files
committed
RANGER-3498: removed log4j-1.x dependency, replaced references to org.apache.log4j and org.apache.commons.logging with org.slf4j - #2
1 parent c169d6d commit d7d58ef

File tree

15 files changed

+104
-12
lines changed

15 files changed

+104
-12
lines changed

agents-audit/pom.xml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@
180180
<groupId>org.elasticsearch</groupId>
181181
<artifactId>jna</artifactId>
182182
</exclusion>
183+
<exclusion>
184+
<groupId>org.apache.logging.log4j</groupId>
185+
<artifactId>*</artifactId>
186+
</exclusion>
183187
</exclusions>
184188
</dependency>
185189
<dependency>
@@ -327,16 +331,6 @@
327331
<artifactId>hppc</artifactId>
328332
<version>${hppc.version}</version>
329333
</dependency>
330-
<dependency>
331-
<groupId>org.apache.logging.log4j</groupId>
332-
<artifactId>log4j-core</artifactId>
333-
<version>${log4j2.version}</version>
334-
</dependency>
335-
<dependency>
336-
<groupId>org.apache.logging.log4j</groupId>
337-
<artifactId>log4j-api</artifactId>
338-
<version>${log4j2.version}</version>
339-
</dependency>
340334
<dependency>
341335
<groupId>org.apache.httpcomponents</groupId>
342336
<artifactId>httpcore</artifactId>

embeddedwebserver/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,10 @@
113113
<artifactId>commons-compress</artifactId>
114114
<version>${commons.compress.version}</version>
115115
</dependency>
116+
<dependency>
117+
<groupId>org.apache.logging.log4j</groupId>
118+
<artifactId>log4j-api</artifactId>
119+
<version>${log4j2.version}</version>
120+
</dependency>
116121
</dependencies>
117122
</project>

hive-agent/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
<artifactId>hive-common</artifactId>
4343
<version>${hive.version}</version>
4444
<exclusions>
45+
<exclusion>
46+
<groupId>org.apache.logging.log4j</groupId>
47+
<artifactId>*</artifactId>
48+
</exclusion>
4549
<exclusion>
4650
<groupId>log4j</groupId>
4751
<artifactId>*</artifactId>
@@ -80,6 +84,10 @@
8084
<groupId>io.netty</groupId>
8185
<artifactId>netty</artifactId>
8286
</exclusion>
87+
<exclusion>
88+
<groupId>org.apache.logging.log4j</groupId>
89+
<artifactId>*</artifactId>
90+
</exclusion>
8391
<exclusion>
8492
<groupId>log4j</groupId>
8593
<artifactId>*</artifactId>
@@ -103,6 +111,10 @@
103111
<groupId>io.netty</groupId>
104112
<artifactId>netty-common</artifactId>
105113
</exclusion>
114+
<exclusion>
115+
<groupId>org.apache.logging.log4j</groupId>
116+
<artifactId>*</artifactId>
117+
</exclusion>
106118
</exclusions>
107119
</dependency>
108120
<dependency>

kms/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@
7373
<artifactId>hadoop-common</artifactId>
7474
<version>${hadoop.version}</version>
7575
<exclusions>
76+
<exclusion>
77+
<groupId>log4j</groupId>
78+
<artifactId>*</artifactId>
79+
</exclusion>
80+
<exclusion>
81+
<groupId>org.slf4j</groupId>
82+
<artifactId>*</artifactId>
83+
</exclusion>
7684
<exclusion>
7785
<groupId>org.apache.commons</groupId>
7886
<artifactId>commons-compress</artifactId>

kms/src/main/java/org/apache/hadoop/crypto/key/RangerGoogleCloudHSMProvider.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222

2323
import org.apache.commons.lang.StringUtils;
2424
import org.apache.hadoop.conf.Configuration;
25-
import org.apache.log4j.Logger;
2625
import org.bouncycastle.crypto.RuntimeCryptoException;
26+
import org.slf4j.Logger;
27+
import org.slf4j.LoggerFactory;
2728

2829
import com.google.api.gax.rpc.AlreadyExistsException;
2930
import com.google.cloud.kms.v1.CryptoKey;
@@ -41,7 +42,7 @@
4142

4243
public class RangerGoogleCloudHSMProvider implements RangerKMSMKI {
4344

44-
private static final Logger logger = Logger.getLogger(RangerGoogleCloudHSMProvider.class);
45+
private static final Logger logger = LoggerFactory.getLogger(RangerGoogleCloudHSMProvider.class);
4546
protected static final String GCP_KEYRING_ID = "ranger.kms.gcp.keyring.id";
4647
protected static final String GCP_CRED_JSON_FILE = "ranger.kms.gcp.cred.file";
4748
protected static final String GCP_PROJECT_ID = "ranger.kms.gcp.project.id";

plugin-elasticsearch/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
<artifactId>elasticsearch</artifactId>
3939
<version>${elasticsearch.version}</version>
4040
<scope>provided</scope>
41+
<exclusions>
42+
<exclusion>
43+
<groupId>org.apache.logging.log4j</groupId>
44+
<artifactId>*</artifactId>
45+
</exclusion>
46+
</exclusions>
4147
</dependency>
4248
<dependency>
4349
<groupId>org.apache.ranger</groupId>

plugin-ozone/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ limitations under the License.
9898
<groupId>org.apache.hadoop</groupId>
9999
<artifactId>hadoop-hdds-common</artifactId>
100100
<version>${ozone.version}</version>
101+
<exclusions>
102+
<exclusion>
103+
<groupId>org.apache.logging.log4j</groupId>
104+
<artifactId>*</artifactId>
105+
</exclusion>
106+
</exclusions>
101107
</dependency>
102108
<dependency>
103109
<groupId>org.apache.hadoop</groupId>

plugin-solr/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151
<artifactId>solr-core</artifactId>
5252
<version>${solr.version}</version>
5353
<exclusions>
54+
<exclusion>
55+
<groupId>org.apache.logging.log4j</groupId>
56+
<artifactId>*</artifactId>
57+
</exclusion>
5458
<exclusion>
5559
<groupId>jdk.tools</groupId>
5660
<artifactId>jdk.tools</artifactId>

ranger-elasticsearch-plugin-shim/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
<artifactId>elasticsearch</artifactId>
3939
<version>${elasticsearch.version}</version>
4040
<scope>provided</scope>
41+
<exclusions>
42+
<exclusion>
43+
<groupId>org.apache.logging.log4j</groupId>
44+
<artifactId>*</artifactId>
45+
</exclusion>
46+
</exclusions>
4147
</dependency>
4248

4349
<dependency>

ranger-hive-plugin-shim/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
<artifactId>hive-common</artifactId>
3737
<version>${hive.version}</version>
3838
<exclusions>
39+
<exclusion>
40+
<groupId>org.apache.logging.log4j</groupId>
41+
<artifactId>*</artifactId>
42+
</exclusion>
3943
<exclusion>
4044
<groupId>log4j</groupId>
4145
<artifactId>*</artifactId>
@@ -78,6 +82,10 @@
7882
<groupId>io.netty</groupId>
7983
<artifactId>netty</artifactId>
8084
</exclusion>
85+
<exclusion>
86+
<groupId>org.apache.logging.log4j</groupId>
87+
<artifactId>*</artifactId>
88+
</exclusion>
8189
<exclusion>
8290
<groupId>log4j</groupId>
8391
<artifactId>*</artifactId>
@@ -105,6 +113,10 @@
105113
<groupId>io.netty</groupId>
106114
<artifactId>netty</artifactId>
107115
</exclusion>
116+
<exclusion>
117+
<groupId>org.apache.logging.log4j</groupId>
118+
<artifactId>*</artifactId>
119+
</exclusion>
108120
</exclusions>
109121
</dependency>
110122
<dependency>

0 commit comments

Comments
 (0)