Skip to content

Commit

Permalink
fix(logging): Remove lombok as source of slf4j-api, convert to compil…
Browse files Browse the repository at this point in the history
…eOnly where possible
  • Loading branch information
david-leifker committed Dec 2, 2022
1 parent 4f7b5ac commit 2ef5aa3
Show file tree
Hide file tree
Showing 30 changed files with 54 additions and 27 deletions.
7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,11 @@ project.ext.externalDependency = [
'kafkaAvroSerde': 'io.confluent:kafka-streams-avro-serde:5.5.1',
'kafkaAvroSerializer': 'io.confluent:kafka-avro-serializer:5.1.4',
'kafkaClients': 'org.apache.kafka:kafka-clients:2.3.0',
'logbackClassic': 'ch.qos.logback:logback-classic:1.2.9',
'logbackClassic': 'ch.qos.logback:logback-classic:1.4.5',
'log4jCore': 'org.apache.logging.log4j:log4j-core:2.19.0',
'log4jApi': 'org.apache.logging.log4j:log4j-api:2.19.0',
'log4j12Api': 'org.slf4j:log4j-over-slf4j:2.0.5',
'slf4jApi': 'org.slf4j:slf4j-api:2.0.5',
'lombok': 'org.projectlombok:lombok:1.18.12',
'mariadbConnector': 'org.mariadb.jdbc:mariadb-java-client:2.6.0',
'mavenArtifact': "org.apache.maven:maven-artifact:$mavenVersion",
Expand Down Expand Up @@ -193,15 +195,12 @@ configure(subprojects.findAll {! it.name.startsWith('spark-lineage') }) {
exclude group: "io.netty", module: "netty"
exclude group: "log4j", module: "log4j"
exclude group: "org.springframework.boot", module: "spring-boot-starter-logging"
exclude group: "ch.qos.logback", module: "logback-classic"
exclude group: "org.apache.logging.log4j", module: "log4j-to-slf4j"
exclude group: "com.vaadin.external.google", module: "android-json"
exclude group: "org.slf4j", module: "slf4j-reload4j"
exclude group: "org.slf4j", module: "slf4j-log4j12"
exclude group: "org.slf4j", module: "slf4j-nop"
exclude group: "org.slf4j", module: "slf4j-ext"
exclude group: "org.slf4j", module: "jul-to-slf4j"
exclude group: "org.slf4j", module: "jcl-over-toslf4j"
}
}

Expand Down
3 changes: 2 additions & 1 deletion datahub-frontend/play.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ dependencies {
testImplementation externalDependency.playTest
testCompile externalDependency.testng

implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
runtime externalDependency.guice
runtime (externalDependency.playDocs) {
exclude group: 'com.typesafe.akka', module: 'akka-http-core_2.12'
}
runtime externalDependency.playGuice
runtime externalDependency.logbackClassic
implementation externalDependency.logbackClassic

annotationProcessor externalDependency.lombok
}
Expand Down
1 change: 1 addition & 0 deletions datahub-graphql-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies {
compile externalDependency.antlr4
compile externalDependency.guava

implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
annotationProcessor externalDependency.lombok

Expand Down
2 changes: 1 addition & 1 deletion datahub-ranger-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies {
exclude group: "org.apache.htrace", module: "htrace-core4"
}
implementation externalDependency.hadoopCommon3
implementation externalDependency.log4jApi
implementation externalDependency.log4j12Api

constraints {
implementation(externalDependency.woodstoxCore) {
Expand Down
3 changes: 2 additions & 1 deletion datahub-upgrade/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ dependencies {
exclude group: 'com.nimbusds', module: 'nimbus-jose-jwt'
exclude group: "org.apache.htrace", module: "htrace-core4"
}
compile externalDependency.lombok
implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
compile externalDependency.picocli
compile externalDependency.parquet
compile externalDependency.springBeans
Expand Down
3 changes: 2 additions & 1 deletion entity-registry/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ dependencies {
compile spec.product.pegasus.data
compile spec.product.pegasus.generator
compile project(path: ':metadata-models')
compile externalDependency.lombok
implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
compile externalDependency.guava
compile externalDependency.jacksonDataBind
compile externalDependency.jacksonDataFormatYaml
Expand Down
4 changes: 2 additions & 2 deletions ingestion-scheduler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ dependencies {
compile project(path: ':metadata-models')
compile project(path: ':metadata-io')
compile project(path: ':metadata-service:restli-client')
compile externalDependency.lombok
implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
annotationProcessor externalDependency.lombok

testCompile externalDependency.mockito
testCompile externalDependency.testng
testAnnotationProcessor externalDependency.lombok

constraints {
implementation(externalDependency.log4jCore) {
Expand Down
1 change: 1 addition & 0 deletions li-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies {
}
compile externalDependency.guava

implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
annotationProcessor externalDependency.lombok

Expand Down
1 change: 1 addition & 0 deletions metadata-dao-impl/kafka-producer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies {

compile externalDependency.kafkaClients

implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok

annotationProcessor externalDependency.lombok
Expand Down
2 changes: 1 addition & 1 deletion metadata-ingestion/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def get_long_description():

delta_lake = {
*s3_base,
"deltalake>=0.6.3",
"deltalake>=0.6.3, != 0.6.4",
}

powerbi_report_server = {"requests", "requests_ntlm"}
Expand Down
3 changes: 2 additions & 1 deletion metadata-integration/java/datahub-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ dependencies {
implementation(externalDependency.kafkaAvroSerializer) {
exclude group: "org.apache.avro"
}


implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
annotationProcessor externalDependency.lombok
testCompile externalDependency.mockito
Expand Down
1 change: 1 addition & 0 deletions metadata-integration/java/datahub-protobuf/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies {
implementation externalDependency.gson
implementation externalDependency.commonsCli

implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
annotationProcessor externalDependency.lombok
testImplementation externalDependency.junitJupiterApi
Expand Down
2 changes: 2 additions & 0 deletions metadata-integration/java/spark-lineage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies {
force = true
} // required for org.apache.commons.io.Charsets that is used internally

implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
annotationProcessor externalDependency.lombok

Expand Down Expand Up @@ -109,6 +110,7 @@ shadowJar {
exclude('module-info.class', 'META-INF/versions/**')

relocate 'com.fasterxml.jackson', 'datahub.shaded.jackson'
relocate 'org.slf4j','datahub.shaded.org.slf4j'
relocate 'org.apache.http','datahub.spark2.shaded.http'
relocate 'org.apache.commons.codec', 'datahub.spark2.shaded.o.a.c.codec'
relocate 'org.apache.commons.compress', 'datahub.spark2.shaded.o.a.c.compress'
Expand Down
2 changes: 2 additions & 0 deletions metadata-io/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ dependencies {
compile spec.product.pegasus.generator

compile externalDependency.dgraph4j exclude group: 'com.google.guava', module: 'guava'
implementation externalDependency.slf4jApi
runtime externalDependency.logbackClassic
compileOnly externalDependency.lombok
implementation externalDependency.commonsCollections
compile externalDependency.datastaxOssNativeProtocol
Expand Down
1 change: 1 addition & 0 deletions metadata-jobs/mae-consumer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies {
compile externalDependency.springKafka
compile externalDependency.springActuator

implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok

annotationProcessor externalDependency.lombok
Expand Down
1 change: 1 addition & 0 deletions metadata-jobs/mce-consumer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies {
compile externalDependency.springKafka
compile externalDependency.springActuator

implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok

annotationProcessor externalDependency.lombok
Expand Down
1 change: 1 addition & 0 deletions metadata-jobs/pe-consumer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies {
}
compile externalDependency.springKafka
compile externalDependency.springActuator
implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
annotationProcessor externalDependency.lombok
runtime externalDependency.logbackClassic
Expand Down
1 change: 1 addition & 0 deletions metadata-models-validator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ dependencies {
compile externalDependency.findbugsAnnotations
compile externalDependency.guava

implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
}
3 changes: 2 additions & 1 deletion metadata-service/auth-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apply plugin: 'java'
dependencies {
compile project(path: ':metadata-models')
compile externalDependency.guava
compile externalDependency.lombok
implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
annotationProcessor externalDependency.lombok
}
3 changes: 2 additions & 1 deletion metadata-service/auth-filter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ dependencies {
compile project(path: ':metadata-service:factories')

compile externalDependency.servletApi
compile externalDependency.lombok
implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
compile externalDependency.springWeb

annotationProcessor externalDependency.lombok
Expand Down
3 changes: 2 additions & 1 deletion metadata-service/auth-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ dependencies {
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.2',
'io.jsonwebtoken:jjwt-jackson:0.11.2'

compile externalDependency.lombok
implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok

annotationProcessor externalDependency.lombok

Expand Down
3 changes: 2 additions & 1 deletion metadata-service/auth-ranger-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ dependencies {
implementation 'org.apache.logging.log4j:log4j-1.2-api:2.17.1'
implementation 'rome:rome:1.0'
runtimeOnly externalDependency.jna
compile externalDependency.lombok
implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok

annotationProcessor externalDependency.lombok
testCompile externalDependency.mockito
Expand Down
3 changes: 2 additions & 1 deletion metadata-service/auth-servlet-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ dependencies {
compile externalDependency.graphqlJava
compile externalDependency.springBeans
compile externalDependency.springContext
compile externalDependency.lombok
implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok

annotationProcessor externalDependency.lombok
}
3 changes: 2 additions & 1 deletion metadata-service/factories/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ dependencies {
compile externalDependency.gson
compile externalDependency.kafkaClients
compile externalDependency.kafkaAvroSerde
compile externalDependency.lombok
implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
compile externalDependency.servletApi
compile externalDependency.springBeans
compile externalDependency.springBootAutoconfigure
Expand Down
3 changes: 2 additions & 1 deletion metadata-service/graphql-servlet-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ dependencies {
compile externalDependency.graphqlJava
compile externalDependency.springBeans
compile externalDependency.springContext
compile externalDependency.lombok
implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok

annotationProcessor externalDependency.lombok
}
6 changes: 4 additions & 2 deletions metadata-service/openapi-servlet/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ dependencies {
compile externalDependency.springWebMVC
compile externalDependency.springBeans
compile externalDependency.springContext
compile externalDependency.lombok
compile externalDependency.antlr4
implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
implementation externalDependency.antlr4Runtime
implementation externalDependency.antlr4

annotationProcessor externalDependency.lombok

Expand Down
3 changes: 2 additions & 1 deletion metadata-service/restli-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ dependencies {
compile project(':metadata-events:mxe-schemas')
compile project(':metadata-utils')

compile externalDependency.lombok
implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok
annotationProcessor externalDependency.lombok

compile spec.product.pegasus.restliClient
Expand Down
3 changes: 2 additions & 1 deletion metadata-service/restli-servlet-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ dependencies {
compile project(':metadata-utils')
compile project(':metadata-io')
compile spec.product.pegasus.restliServer
implementation externalDependency.slf4jApi
// This is compile and not compileOnly because of restli
compile externalDependency.lombok
compile externalDependency.neo4jJavaDriver
compile externalDependency.opentelemetryAnnotations
Expand All @@ -61,7 +63,6 @@ dependencies {
modelValidation project(path: ':metadata-models-validator')
dataModel project(path: ':metadata-models', configuration: 'dataTemplate')
dataModel project(path: ':li-utils', configuration: 'dataTemplate')

}

task integrationTest(type: Test) {
Expand Down
8 changes: 4 additions & 4 deletions metadata-service/war/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ dependencies {
runtime project(':metadata-jobs:mae-consumer')
runtime project(':metadata-jobs:pe-consumer')

runtime externalDependency.logbackClassic
runtime externalDependency.awsSecretsManagerJdbc
runtime externalDependency.h2
runtime externalDependency.logbackClassic
runtime externalDependency.mariadbConnector
runtime externalDependency.mysqlConnector
runtime externalDependency.postgresql
Expand All @@ -28,15 +28,15 @@ dependencies {
}

configurations {
jetty8
jetty9
}

dependencies {
jetty8 "org.eclipse.jetty:jetty-runner:9.4.46.v20220331"
jetty9 "org.eclipse.jetty:jetty-runner:9.4.46.v20220331"
}

task run(type: JavaExec, dependsOn: build) {
main = "org.eclipse.jetty.runner.Runner"
args = [war.archivePath]
classpath configurations.jetty8
classpath configurations.jetty9
}
1 change: 1 addition & 0 deletions metadata-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies {
compile project(':metadata-events:mxe-avro-1.7')
compile project(':metadata-events:mxe-utils-avro-1.7')

implementation externalDependency.slf4jApi
compileOnly externalDependency.lombok

annotationProcessor externalDependency.lombok
Expand Down

0 comments on commit 2ef5aa3

Please sign in to comment.