Skip to content

Commit 1be02a3

Browse files
committed
Add gradle to test version override appendix
- also capture the current version
1 parent 0e7a9c6 commit 1be02a3

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
.idea
77
.project
88
.settings
9+
.sts4-cache
910
.checkstyle
1011
bin
1112
build

src/reference/asciidoc/appendix.adoc

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,21 @@
33

44
When you use `spring-kafka-test` (version 2.2.x) with the 2.1.x `kafka-clients` jar, you need to override certain transitive dependencies, as follows:
55

6+
**maven**
7+
68
====
7-
[source, xml]
9+
[source, xml, subs="+attributes"]
810
----
911
<dependency>
1012
<groupId>org.springframework.kafka</groupId>
1113
<artifactId>spring-kafka</artifactId>
12-
<version>${spring.kafka.version}</version>
14+
<version>{project-version}</version>
1315
</dependency>
1416
1517
<dependency>
1618
<groupId>org.springframework.kafka</groupId>
1719
<artifactId>spring-kafka-test</artifactId>
18-
<version>${spring.kafka.version}</version>
20+
<version>{project-version}</version>
1921
<exclusions>
2022
<exclusion>
2123
<groupId>org.apache.kafka</groupId>
@@ -54,6 +56,28 @@ When you use `spring-kafka-test` (version 2.2.x) with the 2.1.x `kafka-clients`
5456
</dependency>
5557
----
5658
====
59+
60+
**gradle**
61+
62+
====
63+
[source, groovy, subs="+attributes"]
64+
----
65+
dependencies {
66+
67+
implementation 'org.springframework.kafka:spring-kafka:{project-version}'
68+
69+
implementation 'org.apache.kafka:kafka-clients:2.1.1'
70+
testImplementation ('org.springframework.kafka:spring-kafka-test:{project-version}') {
71+
exclude module: 'kafka_2.11'
72+
}
73+
testImplementation 'org.apache.kafka:kafka-clients:2.1.1:test'
74+
testImplementation 'org.apache.kafka:kafka_2.12:2.1.1'
75+
testImplementation 'org.apache.kafka:kafka_2.12:2.1.1:test'
76+
77+
}
78+
----
79+
====
80+
5781
Note that when switching to scala 2.12 (recommended for 2.1.x and higher), the 2.11 version must be excluded from spring-kafka-test.
5882

5983
[appendix]

0 commit comments

Comments
 (0)