Skip to content

Commit 7756506

Browse files
committed
[Build] Require dependency convergence for cucumber-core
To ensure build tools can always resolve `io.cucumber.*` dependencies without conflict our dependencies should converge onto a single version. This check is quite complicated but can be automated with the maven-enforcer-plugin. This check has only been enabled for Cucumber core as requiring convergence of third-party libraries is too cumbersome. This automates the fix for: #1963
1 parent 27e88fd commit 7756506

File tree

4 files changed

+59
-14
lines changed

4 files changed

+59
-14
lines changed

core/pom.xml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<xmlunit.version>2.7.0</xmlunit.version>
1919
<hamcrest-json.version>0.2</hamcrest-json.version>
2020
<vertx.version>3.9.2</vertx.version>
21+
<reactive-streams.version>1.0.3</reactive-streams.version>
2122
</properties>
2223

2324
<dependencies>
@@ -99,12 +100,45 @@
99100
<artifactId>vertx-web</artifactId>
100101
<version>${vertx.version}</version>
101102
<scope>test</scope>
103+
<exclusions>
104+
<!-- Fix dependency convergence -->
105+
<exclusion>
106+
<groupId>com.fasterxml.jackson.core</groupId>
107+
<artifactId>jackson-databind</artifactId>
108+
</exclusion>
109+
<exclusion>
110+
<groupId>com.fasterxml.jackson.core</groupId>
111+
<artifactId>jackson-core</artifactId>
112+
</exclusion>
113+
</exclusions>
102114
</dependency>
103115
<dependency>
104116
<groupId>io.vertx</groupId>
105117
<artifactId>vertx-junit5</artifactId>
106118
<version>${vertx.version}</version>
107119
<scope>test</scope>
120+
<exclusions>
121+
<!-- Fix dependency convergence -->
122+
<exclusion>
123+
<groupId>org.reactivestreams</groupId>
124+
<artifactId>reactive-streams</artifactId>
125+
</exclusion>
126+
<exclusion>
127+
<groupId>com.fasterxml.jackson.core</groupId>
128+
<artifactId>jackson-databind</artifactId>
129+
</exclusion>
130+
<exclusion>
131+
<groupId>com.fasterxml.jackson.core</groupId>
132+
<artifactId>jackson-core</artifactId>
133+
</exclusion>
134+
</exclusions>
135+
</dependency>
136+
<!-- Fix dependency convergence -->
137+
<dependency>
138+
<groupId>org.reactivestreams</groupId>
139+
<artifactId>reactive-streams</artifactId>
140+
<version>${reactive-streams.version}</version>
141+
<scope>test</scope>
108142
</dependency>
109143

110144
<dependency>
@@ -130,6 +164,28 @@
130164
</resource>
131165
</resources>
132166
<plugins>
167+
<plugin>
168+
<groupId>org.apache.maven.plugins</groupId>
169+
<artifactId>maven-enforcer-plugin</artifactId>
170+
<executions>
171+
<execution>
172+
<!-- the cucumber-* dependencies of cucumber-core are
173+
non-trivial. This ensures that we not forget to
174+
update all intermediate dependencies. For instance
175+
when updating messages -->
176+
<id>enforce-dependency-convergence</id>
177+
<configuration>
178+
<rules>
179+
<dependencyConvergence/>
180+
</rules>
181+
</configuration>
182+
<goals>
183+
<goal>enforce</goal>
184+
</goals>
185+
</execution>
186+
</executions>
187+
</plugin>
188+
133189
<plugin>
134190
<groupId>org.apache.maven.plugins</groupId>
135191
<artifactId>maven-jar-plugin</artifactId>

examples/java-calculator/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
<artifactId>cucumber-java</artifactId>
2323
<scope>test</scope>
2424
</dependency>
25-
<dependency>
26-
<groupId>io.cucumber</groupId>
27-
<artifactId>cucumber-gherkin-messages</artifactId>
28-
<scope>test</scope>
29-
</dependency>
3025
<dependency>
3126
<groupId>io.cucumber</groupId>
3227
<artifactId>cucumber-junit</artifactId>

junit-platform-engine/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@
2222
<artifactId>junit-platform-engine</artifactId>
2323
</dependency>
2424

25-
<dependency>
26-
<groupId>io.cucumber</groupId>
27-
<artifactId>cucumber-gherkin-messages</artifactId>
28-
<scope>test</scope>
29-
</dependency>
30-
3125
<dependency>
3226
<groupId>org.hamcrest</groupId>
3327
<artifactId>hamcrest-core</artifactId>

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
<create-meta.version>1.1.0</create-meta.version>
3030
<tag-expressions.version>3.0.0</tag-expressions.version>
3131
<!-- When ever messages is updated run `make update-compatibility` -->
32-
<messages.version>12.3.2</messages.version>
33-
<gherkin.version>14.1.0</gherkin.version>
34-
<html-formatter.version>7.1.0</html-formatter.version>
32+
<messages.version>12.4.0</messages.version>
33+
<gherkin.version>14.2.0</gherkin.version>
34+
<html-formatter.version>7.2.0</html-formatter.version>
3535

3636
<!--Test Dependencies-->
3737
<junit.version>4.13</junit.version>

0 commit comments

Comments
 (0)