This is an automated email from the ASF dual-hosted git repository.
lesun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-gobblin.git
The following commit(s) were added to refs/heads/master by this push:
new b3002c5 [GOBBLIN-1256] Exclude log4j related jars in compile but
include those in test
b3002c5 is described below
commit b3002c51dae865537796018a7013b55d0785a291
Author: Zihan Li <[email protected]>
AuthorDate: Wed Sep 16 14:17:26 2020 -0700
[GOBBLIN-1256] Exclude log4j related jars in compile but include those in
test
Exclude log4j related jars in compile but include
those in test
add comments
Closes #3099 from ZihanLi58/GOBBLIN-1256
---
gradle/scripts/globalDependencies.gradle | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/gradle/scripts/globalDependencies.gradle
b/gradle/scripts/globalDependencies.gradle
index 34e00cd..de3a4af 100644
--- a/gradle/scripts/globalDependencies.gradle
+++ b/gradle/scripts/globalDependencies.gradle
@@ -21,6 +21,7 @@ import javax.tools.ToolProvider
subprojects {
plugins.withType(JavaPlugin) {
configurations {
+ customTestCompile
compile
dependencies {
if (!project.name.contains('gobblin-elasticsearch-deps')) {
@@ -35,20 +36,36 @@ subprojects {
compile(externalDependency.guava) {
force = true
}
- }
- compile(externalDependency.commonsCodec) {
- force = true
- }
+ }
+ compile(externalDependency.commonsCodec) {
+ force = true
+ }
+ //Since testCompile inherit from compile, so we cannot use testCompile
to import dependency for log4j
+ customTestCompile externalDependency.log4j
+ customTestCompile externalDependency.slf4jToLog4j
// Required to add JDK's tool jar, which is required to run byteman
tests.
testCompile (files(((URLClassLoader)
ToolProvider.getSystemToolClassLoader()).getURLs()))
}
+ if (!project.name.contains('gobblin-aws')) {
+ configurations.compile.dependencies*.each {
+ //exclude this jar because we introduce log4j-over-slf4j, these two
jars cannot present at the same time
+ it.exclude group: 'org.slf4j', module: 'slf4j-log4j12'
+ //exclude log4j related jars to provide a clean log environment
+ it.exclude group: 'log4j', module: 'log4j'
+ it.exclude group: 'log4j', module: 'apache-log4j-extras'
+ }
+ }
all*.exclude group: 'org.apache.calcite', module: 'calcite-avatica' //
replaced by org.apache.calcite.avatica:avatica-core
- //exclude this jar because we introduce log4j-over-slf4j, these two jars
cannot present at the same time
- compileClasspath.exclude group: 'org.slf4j', module: 'slf4j-log4j12'
//exclude this jar in test class path because we are using log4j
implementation to test
testCompile.exclude group: 'org.slf4j', module: 'log4j-over-slf4j'
}
+ test{
+ //Add log4j into runtime path
+ classpath += configurations.customTestCompile
+ //Add log4j into compile path
+ sourceSets.test.compileClasspath += configurations.customTestCompile
+ }
}
dependencies {