This is an automated email from the ASF dual-hosted git repository. granthenke pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/kudu.git
commit a6c93313aae7f40fb8d6b87fb6f6d875b42c068b Author: Grant Henke <[email protected]> AuthorDate: Tue Oct 13 13:53:14 2020 -0500 [subprocess] Avoid transitive log4j dependencies This patch excludes the log4j and slf4j dependencies from the Hadoop and Ranger dependencies to ensure we use only our explicitly defined versions. This patch also adds a test log4j2.properties file that was missing. Change-Id: I48db5ee55e0f8d9f38b0351b2b3f7509175f6320 Reviewed-on: http://gerrit.cloudera.org:8080/16592 Tested-by: Kudu Jenkins Reviewed-by: Andrew Wong <[email protected]> --- java/kudu-subprocess/build.gradle | 11 +++++--- .../src/test/resources/log4j2.properties | 32 ++++++++++++++++++++++ 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/java/kudu-subprocess/build.gradle b/java/kudu-subprocess/build.gradle index d262659..45360aa 100644 --- a/java/kudu-subprocess/build.gradle +++ b/java/kudu-subprocess/build.gradle @@ -25,6 +25,9 @@ dependencies { compile(libs.hadoopCommon) { // hadoopCommon and rangerPlugin use different versions of jersey. exclude group: "com.sun.jersey" + // Exclude log4j and slf4j to ensure we use our own versions. + exclude group: "log4j" + exclude group: "org.slf4j" } compile libs.protobufJava compile libs.protobufJavaUtil @@ -33,10 +36,14 @@ dependencies { // rangerPlugin depends on kafka which includes different versions // of jersey than rangerPlugin. exclude group: "org.apache.kafka" + // Exclude log4j and slf4j to ensure we use our own versions. + exclude group: "log4j" + exclude group: "org.slf4j" } compile libs.slf4jApi compile libs.log4jApi compile libs.log4jCore + compile libs.log4jCompat compile libs.log4jSlf4jImpl optional libs.jsr305 @@ -44,10 +51,6 @@ dependencies { testCompile project(path: ":kudu-test-utils", configuration: "shadow") testCompile libs.junit - testCompile libs.log4jApi - testCompile libs.log4jCompat - testCompile libs.log4jCore - testCompile libs.log4jSlf4jImpl testCompile libs.mockitoCore } diff --git a/java/kudu-subprocess/src/test/resources/log4j2.properties b/java/kudu-subprocess/src/test/resources/log4j2.properties new file mode 100644 index 0000000..22762a1 --- /dev/null +++ b/java/kudu-subprocess/src/test/resources/log4j2.properties @@ -0,0 +1,32 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +status = error +name = PropertiesConfig +appenders = console + +appender.console.type = Console +appender.console.name = STDOUT +appender.console.layout.type = PatternLayout +appender.console.layout.pattern = %d{HH:mm:ss.SSS} [%p - %t] (%F:%L) %m%n + +rootLogger.level = info +rootLogger.appenderRefs = stdout +rootLogger.appenderRef.stdout.ref = STDOUT + +logger.kudu.name = org.apache.kudu +logger.kudu.level = debug
