Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kafka test jars are included in spring-kafka-test #3825

Open
rob-valor opened this issue Mar 26, 2025 · 6 comments
Open

kafka test jars are included in spring-kafka-test #3825

rob-valor opened this issue Mar 26, 2025 · 6 comments

Comments

@rob-valor
Copy link

The tests jar of kakfa-clients and kafka-server-commons are included in spring-kafka-test. Both include a junit-platform.properties configuration file which results in WARNING: Discovered 2 'junit-platform.properties' configuration files in the classpath; only the first will be used.

I can't really find any reason why those test jars are included.

@artembilan
Copy link
Member

This is known issue: https://issues.apache.org/jira/browse/KAFKA-17121.

You can try to exclude those dependencies, but I think somewhere in the KafkaClusterTestKit hierarchy some of those classes are used.

We are right now in 4.0 generation, so we can revise some of those transitive dependencies for a minimum.
Might be the case that some of those were used for Zookeeper mode which is not there any more.

@sobychacko
Copy link
Contributor

Ya, @artembilan, I was also curious about this issue and was looking. As you said, we can probably remove those dependencies and see what breaks in 4.0.

@artembilan
Copy link
Member

Well, I see that issue has been fixed in Kafka 3.9.0.
You can just upgrade your project to that one: https://docs.spring.io/spring-kafka/reference/appendix/override-boot-dependencies.html

@rob-valor
Copy link
Author

I just ran our tests with both kafka-clients and kafka-server-common excluded from spring-kafka-test. That also does the job 😁. We run our tests with a Confluent Kafka container 😉

@artembilan
Copy link
Member

I am confused.
If you use Confluent Kafka container then you don't need embedded Kafka at all.
And might be the case that you don't need spring-kafka-test altogether.
That did a job for you because you don't use an @EmbeddedKafka in your project.
Therefore there might not be the pass where a call to those test artifacts would happen.

@rob-valor
Copy link
Author

I'll check why spring-kafka-test is included in the project 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants