Skip to content

Commit bd95e38

Browse files
authored
Add Maven Enforcer plugin to keep dependency versions in sync (#625)
This updates some library versions and adds exclusions so that the common shared dependencies are all the same version.
1 parent 3b77a83 commit bd95e38

File tree

4 files changed

+148
-5
lines changed

4 files changed

+148
-5
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Changelog for Management API, new PRs should update the `main / unreleased` sect
1010
```
1111

1212
## unreleased
13-
13+
* [ENHANCEMENT] [#624](https://github.com/k8ssandra/management-api-for-apache-cassandra/issues/624) Add Maven Enforcer plugin to keep dependency versions in sync
1414
* [BUGFIX] [#577](https://github.com/k8ssandra/management-api-for-apache-cassandra/issues/577) pool_name can include dashes and slashes.
1515

1616
## v0.1.100 [2-25-03-24]

management-api-agent-common/pom.xml

+8
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@
7474
<groupId>com.fasterxml.jackson.dataformat</groupId>
7575
<artifactId>jackson-dataformat-yaml</artifactId>
7676
</exclusion>
77+
<exclusion>
78+
<groupId>org.slf4j</groupId>
79+
<artifactId>slf4j-api</artifactId>
80+
</exclusion>
81+
<exclusion>
82+
<groupId>io.netty</groupId>
83+
<artifactId>netty-handler</artifactId>
84+
</exclusion>
7785
</exclusions>
7886
</dependency>
7987
<dependency>

management-api-server/pom.xml

+116-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@
1717
<artifactId>datastax-mgmtapi-server</artifactId>
1818
<properties>
1919
<guava.version>33.4.0-jre</guava.version>
20-
<airline.version>2.7.0</airline.version>
21-
<jaxrs.version>2.2.19</jaxrs.version>
22-
<resteasy.version>6.2.10.Final</resteasy.version>
20+
<airline.version>3.0.0</airline.version>
21+
<jaxrs.version>2.2.28</jaxrs.version>
22+
<resteasy.version>6.2.12.Final</resteasy.version>
2323
<awaitility.version>4.0.3</awaitility.version>
2424
<assertj.version>3.17.2</assertj.version>
2525
<servelet.version>6.1.0</servelet.version>
2626
<commons.io.version>2.17.0</commons.io.version>
27+
<apache.commons.lang3.version>3.17.0</apache.commons.lang3.version>
28+
<jakarta.activation.version>2.1.3</jakarta.activation.version>
29+
<jakarta.validation.version>3.1.0</jakarta.validation.version>
2730
</properties>
2831
<dependencies>
2932
<dependency>
@@ -45,12 +48,23 @@
4548
<groupId>ch.qos.logback</groupId>
4649
<artifactId>logback-classic</artifactId>
4750
<version>${logback.version}</version>
51+
<exclusions>
52+
<exclusion>
53+
<groupId>org.slf4j</groupId>
54+
<artifactId>slf4j-api</artifactId>
55+
</exclusion>
56+
</exclusions>
4857
</dependency>
4958
<dependency>
5059
<groupId>commons-io</groupId>
5160
<artifactId>commons-io</artifactId>
5261
<version>${commons.io.version}</version>
5362
</dependency>
63+
<dependency>
64+
<groupId>org.apache.commons</groupId>
65+
<artifactId>commons-lang3</artifactId>
66+
<version>${apache.commons.lang3.version}</version>
67+
</dependency>
5468
<dependency>
5569
<groupId>com.google.guava</groupId>
5670
<artifactId>guava</artifactId>
@@ -60,21 +74,97 @@
6074
<groupId>com.github.rvesse</groupId>
6175
<artifactId>airline</artifactId>
6276
<version>${airline.version}</version>
77+
<exclusions>
78+
<exclusion>
79+
<groupId>org.apache.commons</groupId>
80+
<artifactId>commons-lang3</artifactId>
81+
</exclusion>
82+
</exclusions>
83+
</dependency>
84+
<!-- Jakarta dependencies to keep in sync -->
85+
<dependency>
86+
<groupId>jakarta.activation</groupId>
87+
<artifactId>jakarta.activation-api</artifactId>
88+
<version>${jakarta.activation.version}</version>
89+
</dependency>
90+
<dependency>
91+
<groupId>jakarta.validation</groupId>
92+
<artifactId>jakarta.validation-api</artifactId>
93+
<version>${jakarta.validation.version}</version>
6394
</dependency>
95+
<!-- the next 3 Jackson dependnecies are here explictly to keep the versions
96+
the same as what we use in the common modules. They are normally pulled
97+
in transitively by swagger-jaxrs2-jakarta below -->
98+
<dependency>
99+
<groupId>com.fasterxml.jackson.core</groupId>
100+
<artifactId>jackson-databind</artifactId>
101+
<version>${jackson-dataformat.version}</version>
102+
</dependency>
103+
<dependency>
104+
<groupId>com.fasterxml.jackson.dataformat</groupId>
105+
<artifactId>jackson-dataformat-yaml</artifactId>
106+
<version>${jackson-dataformat.version}</version>
107+
</dependency>
108+
<dependency>
109+
<groupId>com.fasterxml.jackson.jakarta.rs</groupId>
110+
<artifactId>jackson-jakarta-rs-json-provider</artifactId>
111+
<version>${jackson-dataformat.version}</version>
112+
<exclusions>
113+
<exclusion>
114+
<groupId>jakarta.activation</groupId>
115+
<artifactId>jakarta.activation-api</artifactId>
116+
</exclusion>
117+
<exclusion>
118+
<groupId>jakarta.validation</groupId>
119+
<artifactId>jakarta.validation-api</artifactId>
120+
</exclusion>
121+
</exclusions>
122+
</dependency>
123+
<!-- end of Jackson libraries to explicity declare -->
64124
<dependency>
65125
<groupId>io.swagger.core.v3</groupId>
66126
<artifactId>swagger-jaxrs2-jakarta</artifactId>
67127
<version>${jaxrs.version}</version>
128+
<exclusions>
129+
<exclusion>
130+
<groupId>com.fasterxml.jackson.core</groupId>
131+
<artifactId>*</artifactId>
132+
</exclusion>
133+
<exclusion>
134+
<groupId>com.fasterxml.jackson.dataformat</groupId>
135+
<artifactId>jackson-dataformat-yaml</artifactId>
136+
</exclusion>
137+
<exclusion>
138+
<groupId>com.fasterxml.jackson.jakarta.rs</groupId>
139+
<artifactId>jackson-jakarta-rs-json-provider</artifactId>
140+
</exclusion>
141+
<exclusion>
142+
<groupId>com.fasterxml.jackson.datatype</groupId>
143+
<artifactId>*</artifactId>
144+
</exclusion>
145+
</exclusions>
68146
</dependency>
69147
<dependency>
70148
<groupId>org.jboss.resteasy</groupId>
71149
<artifactId>resteasy-netty4</artifactId>
72150
<version>${resteasy.version}</version>
151+
<exclusions>
152+
<exclusion>
153+
<groupId>jakarta.validation</groupId>
154+
<artifactId>jakarta.validation-api</artifactId>
155+
</exclusion>
156+
</exclusions>
73157
</dependency>
74158
<dependency>
75159
<groupId>org.jboss.resteasy</groupId>
76160
<artifactId>resteasy-jackson2-provider</artifactId>
77161
<version>${resteasy.version}</version>
162+
<exclusions>
163+
<exclusion>
164+
<groupId>com.fasterxml.jackson.core</groupId>
165+
<artifactId>*</artifactId>
166+
</exclusion>
167+
</exclusions>
78168
</dependency>
79169
<dependency>
80170
<groupId>io.netty</groupId>
@@ -85,12 +175,35 @@
85175
<groupId>com.datastax.oss</groupId>
86176
<artifactId>java-driver-core</artifactId>
87177
<version>${driver.version}</version>
178+
<exclusions>
179+
<exclusion>
180+
<groupId>com.fasterxml.jackson.core</groupId>
181+
<artifactId>*</artifactId>
182+
</exclusion>
183+
<exclusion>
184+
<groupId>io.netty</groupId>
185+
<artifactId>*</artifactId>
186+
</exclusion>
187+
<exclusion>
188+
<groupId>org.slf4j</groupId>
189+
<artifactId>slf4j-api</artifactId>
190+
</exclusion>
191+
<exclusion>
192+
<groupId>org.reactivestreams</groupId>
193+
<artifactId>reactive-streams</artifactId>
194+
</exclusion>
195+
</exclusions>
88196
</dependency>
89197
<dependency>
90198
<groupId>jakarta.servlet</groupId>
91199
<artifactId>jakarta.servlet-api</artifactId>
92200
<version>${servelet.version}</version>
93201
</dependency>
202+
<dependency>
203+
<groupId>javax.inject</groupId>
204+
<artifactId>javax.inject</artifactId>
205+
<version>1</version>
206+
</dependency>
94207
<dependency>
95208
<groupId>com.github.docker-java</groupId>
96209
<artifactId>docker-java</artifactId>

pom.xml

+23-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<build.version.file>build_version.sh</build.version.file>
2626
<slf4j.version>2.0.9</slf4j.version>
2727
<logback.version>1.4.14</logback.version>
28-
<netty.version>4.1.118.Final</netty.version>
28+
<netty.version>4.1.119.Final</netty.version>
2929
<mockito.version>3.5.13</mockito.version>
3030
<prometheus.version>0.16.0</prometheus.version>
3131
<!-- This old version is used by Cassandra 4.x -->
@@ -191,6 +191,11 @@
191191
<artifactId>maven-shade-plugin</artifactId>
192192
<version>${maven.shade.version}</version>
193193
</plugin>
194+
<plugin>
195+
<groupId>org.apache.maven.plugins</groupId>
196+
<artifactId>maven-enforcer-plugin</artifactId>
197+
<version>3.5.0</version>
198+
</plugin>
194199
</plugins>
195200
</pluginManagement>
196201
<plugins>
@@ -262,6 +267,23 @@ Please see the included license file for details.]]></inlineHeader>
262267
</execution>
263268
</executions>
264269
</plugin>
270+
<plugin>
271+
<groupId>org.apache.maven.plugins</groupId>
272+
<artifactId>maven-enforcer-plugin</artifactId>
273+
<executions>
274+
<execution>
275+
<id>enforce</id>
276+
<configuration>
277+
<rules>
278+
<dependencyConvergence/>
279+
</rules>
280+
</configuration>
281+
<goals>
282+
<goal>enforce</goal>
283+
</goals>
284+
</execution>
285+
</executions>
286+
</plugin>
265287
</plugins>
266288
</build>
267289
</project>

0 commit comments

Comments
 (0)