KAFKA-18466: Remove log4j-1.2-api from runtime scope while keeping it in distribution package#18472
Conversation
|
@frankvicky please build the distribution and Pom file and then check the content, thanks! |
e4d37ae to
e0272f6
Compare
|
Similarly to apache/eventmesh#4700, I think that:
|
|
I totally agree @ppkarwasz's suggestion. Additionally, |
+1
Gradle apparently has a feature for that, see Optional dependencies are not optional. With a snippet like: java {
registerFeature('loggingConfig') {
usingSourceSet(sourceSets.main)
}
}it should be possible to:
|
e0272f6 to
eb55146
Compare
|
Hi @ppkarwasz, Should we make I'm running the kafka e2e on my local machine, it would fail with following log: It seems we still need |
chia7712
left a comment
There was a problem hiding this comment.
It seems we still need log4j-slf4j-impl at runtime. WDYT ?
please add the log4jRuntimeLibs to copyDependantLibs too. Our docker e2e depends on systemTestLibs task by default, and the task copies the dependencies to dependant-testlibs folder
| } | ||
|
|
||
| dependencies { | ||
| loggingImplementation log4j2Libs |
There was a problem hiding this comment.
I think only core and connect-runtime needs to add log4j2Libs to compileOnly scope.
eb55146 to
68bc81c
Compare
68bc81c to
07ec3ea
Compare
… in distribution package
07ec3ea to
af1a063
Compare
chia7712
left a comment
There was a problem hiding this comment.
LGTM
test the latest commit on my local.
chia7712@chia7712-ubuntu:~$ cat ~/.m2/repository/org/apache/kafka/kafka_2.13/4.1.0-SNAPSHOT/kafka_2.13-4.1.0-SNAPSHOT.pom | grep log4j
chia7712@chia7712-ubuntu:~$
chia7712@chia7712-ubuntu:~$ cat ~/.m2/repository/org/apache/kafka/kafka-clients/4.1.0-SNAPSHOT/kafka-clients-4.1.0-SNAPSHOT.pom | grep log4j
chia7712@chia7712-ubuntu:~$ cat ~/.m2/repository/org/apache/kafka/kafka-clients/4.1.0-SNAPSHOT/kafka-clients-4.1.0-SNAPSHOT.pom | grep slf4j
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
chia7712@chia7712-ubuntu:~$ cat ~/.m2/repository/org/apache/kafka/kafka-streams/4.1.0-SNAPSHOT/kafka-streams-4.1.0-SNAPSHOT.pom | grep log4j
chia7712@chia7712-ubuntu:~$ cat ~/.m2/repository/org/apache/kafka/kafka-streams/4.1.0-SNAPSHOT/kafka-streams-4.1.0-SNAPSHOT.pom | grep slf4j
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
|
@ppkarwasz we don't use the Gradle’s feature variants in this PR due to following reasons.
I will merge this PR to fix the issue reported by @trnguyencflt, but please feel free to leave suggestions as follow-up, thanks! |
…in distribution package (#18472) Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
The PR looks good to me now. For a POM file having |
|
thanks all for the quick fix 👍 |
…in distribution package (apache#18472) Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
…in distribution package (apache#18472) Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
…in distribution package (apache#18472) Reviewers: Chia-Ping Tsai <chia7712@gmail.com>







JIRA: KAFKA-18466
This PR is a patch for #17373 (comment)
Committer Checklist (excluded from commit message)