Skip to content

Commit addb888

Browse files
committed
Update Docs For Overriding Boot Dependencies (#2564)
1 parent 083aff6 commit addb888

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

spring-kafka-docs/src/main/asciidoc/appendix.adoc

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
== Override Spring Boot Dependencies
33

44
When using Spring for Apache Kafka in a Spring Boot application, the Apache Kafka dependency versions are determined by Spring Boot's dependency management.
5-
If you wish to use a different version of `kafka-clients` or `kafka-streams`, and use the embedded kafka broker for testing, you need to override their version used by Spring Boot dependency management and add two `test` artifacts for Apache Kafka.
5+
If you wish to use a different version of `kafka-clients` or `kafka-streams`, and use the embedded kafka broker for testing, you need to override their version used by Spring Boot dependency management; set the `kafka.version` property.
6+
7+
Or, to use a different Spring for Apache Kafka version with a supported Spring Boot version, set the `spring-kafka.version` property.
68

79
====
810
[source, xml, subs="+attributes", role="primary"]
911
.Maven
1012
----
1113
<properties>
12-
<kafka.version>3.3.2</kafka.version>
14+
<kafka.version>3.4.0</kafka.version>
15+
<spring-kafka.version>{project-version}</spring-kafka.version>
1316
</properties>
1417
1518
<dependency>
@@ -32,17 +35,13 @@ If you wish to use a different version of `kafka-clients` or `kafka-streams`, an
3235
[source, groovy, subs="+attributes", role="secondary"]
3336
.Gradle
3437
----
35-
ext['kafka.version'] = '3.2.3'
38+
ext['kafka.version'] = '3.4.0'
39+
ext['spring-kafka.version'] = '{project-version}'
3640
3741
dependencies {
3842
implementation 'org.springframework.kafka:spring-kafka'
39-
implementation "org.apache.kafka:kafka-streams" // optional - only needed when using kafka-streams
40-
testImplementation ('org.springframework.kafka:spring-kafka-test') {
41-
// needed if downgrading to Apache Kafka 2.8.1
42-
exclude group: 'org.apache.zookeeper', module: 'zookeeper'
43-
}
44-
testImplementation "org.apache.kafka:kafka-clients:${kafka.version}:test"
45-
testImplementation "org.apache.kafka:kafka_2.13:${kafka.version}:test"
43+
implementation 'org.apache.kafka:kafka-streams' // optional - only needed when using kafka-streams
44+
testImplementation 'org.springframework.kafka:spring-kafka-test'
4645
}
4746
----
4847
====

0 commit comments

Comments
 (0)