Skip to content

Commit fa3237a

Browse files
committed
Add proper dependency management to Maven build (#592)
Signed-off-by: Jakub Scholz <[email protected]>
1 parent be48fd7 commit fa3237a

File tree

3 files changed

+110
-39
lines changed

3 files changed

+110
-39
lines changed

pom.xml

Lines changed: 107 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,28 @@
8282
<maven.compiler.source>1.8</maven.compiler.source>
8383
<maven.compiler.target>1.8</maven.compiler.target>
8484
<log4j.version>2.17.1</log4j.version>
85+
<slf4j.version>1.7.21</slf4j.version>
8586
<vertx.version>4.2.4</vertx.version>
87+
<netty.version>4.1.73.Final</netty.version>
8688
<kafka.version>2.8.1</kafka.version>
89+
<qpid-proton.version>0.33.10</qpid-proton.version>
8790
<kafka-kubernetes-config-provider.version>1.0.0</kafka-kubernetes-config-provider.version>
8891
<kafka-env-var-config-provider.version>1.0.0</kafka-env-var-config-provider.version>
8992
<debezium.version>1.2.3.Final</debezium.version>
9093
<maven.checkstyle.version>3.1.2</maven.checkstyle.version>
9194
<hamcrest.version>2.2</hamcrest.version>
95+
<junit.version>5.8.2</junit.version>
9296
<maven-jar-plugin.version>3.1.2</maven-jar-plugin.version>
9397
<maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
9498
<maven-failsafe-plugin.version>3.0.0-M5</maven-failsafe-plugin.version>
9599
<maven.assembly.version>3.1.0</maven.assembly.version>
96100
<maven.javadoc.version>3.1.0</maven.javadoc.version>
97101
<maven.source.version>3.0.1</maven.source.version>
102+
<maven.dependency.version>3.1.1</maven.dependency.version>
98103
<maven.gpg.version>1.6</maven.gpg.version>
99104
<sonatype.nexus.staging>1.6.3</sonatype.nexus.staging>
100105
<swagger2markup.version>1.3.7</swagger2markup.version>
101106
<jackson-core.version>2.13.1</jackson-core.version>
102-
<netty.version>4.1.72.Final</netty.version>
103107
<tomcat-embed-core.version>8.5.73</tomcat-embed-core.version>
104108
<spotbugs.version>4.0.1</spotbugs.version>
105109
<strimzi-oauth.version>0.9.0</strimzi-oauth.version>
@@ -108,6 +112,7 @@
108112
<opentracing-kafka-client.version>0.1.15</opentracing-kafka-client.version>
109113
<micrometer.version>1.3.9</micrometer.version>
110114
<jmx-prometheus-collector.version>0.12.0</jmx-prometheus-collector.version>
115+
<prometheus-simpleclient.version>0.7.0</prometheus-simpleclient.version>
111116
<commons-cli.version>1.4</commons-cli.version>
112117
<test-container.version>0.100.0</test-container.version>
113118
<jakarta.version>2.3.2</jakarta.version>
@@ -117,6 +122,11 @@
117122
</properties>
118123

119124
<dependencies>
125+
<dependency>
126+
<groupId>io.vertx</groupId>
127+
<artifactId>vertx-core</artifactId>
128+
<version>${vertx.version}</version>
129+
</dependency>
120130
<dependency>
121131
<groupId>io.vertx</groupId>
122132
<artifactId>vertx-proton</artifactId>
@@ -132,11 +142,26 @@
132142
<artifactId>vertx-web</artifactId>
133143
<version>${vertx.version}</version>
134144
</dependency>
145+
<dependency>
146+
<groupId>io.vertx</groupId>
147+
<artifactId>vertx-web-common</artifactId>
148+
<version>${vertx.version}</version>
149+
</dependency>
135150
<dependency>
136151
<groupId>io.vertx</groupId>
137152
<artifactId>vertx-web-openapi</artifactId>
138153
<version>${vertx.version}</version>
139154
</dependency>
155+
<dependency>
156+
<groupId>io.vertx</groupId>
157+
<artifactId>vertx-web-validation</artifactId>
158+
<version>${vertx.version}</version>
159+
</dependency>
160+
<dependency>
161+
<groupId>io.vertx</groupId>
162+
<artifactId>vertx-json-schema</artifactId>
163+
<version>${vertx.version}</version>
164+
</dependency>
140165
<dependency>
141166
<groupId>io.vertx</groupId>
142167
<artifactId>vertx-config</artifactId>
@@ -152,11 +177,31 @@
152177
<artifactId>kafka-clients</artifactId>
153178
<version>${kafka.version}</version>
154179
</dependency>
180+
<dependency>
181+
<groupId>org.apache.qpid</groupId>
182+
<artifactId>proton-j</artifactId>
183+
<version>${qpid-proton.version}</version>
184+
</dependency>
185+
<dependency>
186+
<groupId>io.netty</groupId>
187+
<artifactId>netty-codec-http</artifactId>
188+
<version>${netty.version}</version>
189+
</dependency>
190+
<dependency>
191+
<groupId>io.netty</groupId>
192+
<artifactId>netty-common</artifactId>
193+
<version>${netty.version}</version>
194+
</dependency>
155195
<dependency>
156196
<groupId>com.fasterxml.jackson.core</groupId>
157-
<artifactId>jackson-core</artifactId>
197+
<artifactId>jackson-databind</artifactId>
158198
<version>${jackson-core.version}</version>
159199
</dependency>
200+
<dependency>
201+
<groupId>org.slf4j</groupId>
202+
<artifactId>slf4j-api</artifactId>
203+
<version>${slf4j.version}</version>
204+
</dependency>
160205
<dependency>
161206
<groupId>org.apache.logging.log4j</groupId>
162207
<artifactId>log4j-api</artifactId>
@@ -183,6 +228,16 @@
183228
<artifactId>kafka-oauth-client</artifactId>
184229
<version>${strimzi-oauth.version}</version>
185230
</dependency>
231+
<dependency>
232+
<groupId>jakarta.xml.bind</groupId>
233+
<artifactId>jakarta.xml.bind-api</artifactId>
234+
<version>${jakarta.version}</version>
235+
</dependency>
236+
<dependency>
237+
<groupId>io.jaegertracing</groupId>
238+
<artifactId>jaeger-core</artifactId>
239+
<version>${jaeger.version}</version>
240+
</dependency>
186241
<dependency>
187242
<groupId>io.jaegertracing</groupId>
188243
<artifactId>jaeger-client</artifactId>
@@ -203,6 +258,11 @@
203258
<artifactId>opentracing-kafka-client</artifactId>
204259
<version>${opentracing-kafka-client.version}</version>
205260
</dependency>
261+
<dependency>
262+
<groupId>io.micrometer</groupId>
263+
<artifactId>micrometer-core</artifactId>
264+
<version>${micrometer.version}</version>
265+
</dependency>
206266
<dependency>
207267
<groupId>io.micrometer</groupId>
208268
<artifactId>micrometer-registry-prometheus</artifactId>
@@ -213,6 +273,21 @@
213273
<artifactId>collector</artifactId>
214274
<version>${jmx-prometheus-collector.version}</version>
215275
</dependency>
276+
<dependency>
277+
<groupId>io.prometheus</groupId>
278+
<artifactId>simpleclient</artifactId>
279+
<version>${prometheus-simpleclient.version}</version>
280+
</dependency>
281+
<dependency>
282+
<groupId>io.prometheus</groupId>
283+
<artifactId>simpleclient_common</artifactId>
284+
<version>${prometheus-simpleclient.version}</version>
285+
</dependency>
286+
<dependency>
287+
<groupId>io.prometheus.jmx</groupId>
288+
<artifactId>collector</artifactId>
289+
<version>${jmx-prometheus-collector.version}</version>
290+
</dependency>
216291
<dependency>
217292
<groupId>commons-cli</groupId>
218293
<artifactId>commons-cli</artifactId>
@@ -244,32 +319,13 @@
244319
<artifactId>kafka-env-var-config-provider</artifactId>
245320
<version>${kafka-env-var-config-provider.version}</version>
246321
</dependency>
247-
248322
<!-- Transitive dependency version overrides for Vulnerabilities: -->
249-
<!-- overriding version commons-io for Vert.x - Vulnerability -->
250-
<dependency>
251-
<groupId>commons-io</groupId>
252-
<artifactId>commons-io</artifactId>
253-
<version>2.7</version>
254-
</dependency>
255323
<!-- overriding version of snakeyaml for prometheus.jmx.collector 0.12.0: Vulnerability: DOS -->
256324
<dependency>
257325
<groupId>org.yaml</groupId>
258326
<artifactId>snakeyaml</artifactId>
259327
<version>1.29</version>
260328
</dependency>
261-
<!-- overriding version of netty-codec for Vert.x - Vulnerability -->
262-
<dependency>
263-
<groupId>io.netty</groupId>
264-
<artifactId>netty-codec</artifactId>
265-
<version>${netty.version}</version>
266-
</dependency>
267-
<!-- overriding version of netty-handler for Vert.x - Vulnerability -->
268-
<dependency>
269-
<groupId>io.netty</groupId>
270-
<artifactId>netty-handler</artifactId>
271-
<version>${netty.version}</version>
272-
</dependency>
273329
<!-- overriding version of tomcat-embed-core for jaegertracing - Vulnerability -->
274330
<dependency>
275331
<groupId>org.apache.tomcat.embed</groupId>
@@ -278,9 +334,9 @@
278334
</dependency>
279335
<!-- Testing -->
280336
<dependency>
281-
<groupId>io.vertx</groupId>
282-
<artifactId>vertx-unit</artifactId>
283-
<version>${vertx.version}</version>
337+
<groupId>org.junit.jupiter</groupId>
338+
<artifactId>junit-jupiter-api</artifactId>
339+
<version>${junit.version}</version>
284340
<scope>test</scope>
285341
</dependency>
286342
<dependency>
@@ -303,27 +359,16 @@
303359
</dependency>
304360
<dependency>
305361
<groupId>org.hamcrest</groupId>
306-
<artifactId>hamcrest-library</artifactId>
362+
<artifactId>hamcrest</artifactId>
307363
<version>${hamcrest.version}</version>
308364
<scope>test</scope>
309365
</dependency>
310-
<dependency>
311-
<groupId>org.apache.kafka</groupId>
312-
<artifactId>kafka_2.12</artifactId>
313-
<version>${kafka.version}</version>
314-
<scope>test</scope>
315-
</dependency>
316366
<dependency>
317367
<groupId>io.strimzi</groupId>
318368
<artifactId>strimzi-test-container</artifactId>
319369
<version>${test-container.version}</version>
320370
<scope>test</scope>
321371
</dependency>
322-
<dependency>
323-
<groupId>jakarta.xml.bind</groupId>
324-
<artifactId>jakarta.xml.bind-api</artifactId>
325-
<version>${jakarta.version}</version>
326-
</dependency>
327372
</dependencies>
328373

329374
<pluginRepositories>
@@ -435,6 +480,32 @@
435480
</execution>
436481
</executions>
437482
</plugin>
483+
<plugin>
484+
<groupId>org.apache.maven.plugins</groupId>
485+
<artifactId>maven-dependency-plugin</artifactId>
486+
<version>${maven.dependency.version}</version>
487+
<executions>
488+
<execution>
489+
<id>analyze</id>
490+
<goals>
491+
<goal>analyze-only</goal>
492+
</goals>
493+
<configuration>
494+
<failOnWarning>true</failOnWarning>
495+
<ignoredUnusedDeclaredDependencies>
496+
<ignoredUnusedDeclaredDependency>io.strimzi:kafka-env-var-config-provider</ignoredUnusedDeclaredDependency>
497+
<ignoredUnusedDeclaredDependency>io.strimzi:kafka-kubernetes-config-provider</ignoredUnusedDeclaredDependency>
498+
<ignoredUnusedDeclaredDependency>io.strimzi:kafka-oauth-client</ignoredUnusedDeclaredDependency>
499+
<ignoredUnusedDeclaredDependency>org.apache.logging.log4j:log4j-core</ignoredUnusedDeclaredDependency>
500+
<ignoredUnusedDeclaredDependency>org.apache.logging.log4j:log4j-slf4j-impl</ignoredUnusedDeclaredDependency>
501+
<ignoredUnusedDeclaredDependency>io.jaegertracing:jaeger-client</ignoredUnusedDeclaredDependency>
502+
<ignoredUnusedDeclaredDependency>org.yaml:snakeyaml</ignoredUnusedDeclaredDependency> <!-- CVE override -->
503+
<ignoredUnusedDeclaredDependency>org.apache.tomcat.embed:tomcat-embed-core</ignoredUnusedDeclaredDependency> <!-- CVE override -->
504+
</ignoredUnusedDeclaredDependencies>
505+
</configuration>
506+
</execution>
507+
</executions>
508+
</plugin>
438509
<plugin>
439510
<groupId>org.apache.maven.plugins</groupId>
440511
<artifactId>maven-source-plugin</artifactId>

src/test/java/io/strimzi/kafka/bridge/amqp/AmqpSinkBridgeEndpointMockTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.apache.qpid.proton.amqp.messaging.Source;
3636
import org.apache.qpid.proton.amqp.transport.ErrorCondition;
3737
import org.apache.qpid.proton.message.Message;
38+
import org.junit.jupiter.api.Assertions;
3839
import org.junit.jupiter.api.Disabled;
3940
import org.junit.jupiter.api.Test;
4041
import org.mockito.ArgumentCaptor;
@@ -48,7 +49,6 @@
4849
import java.util.Map;
4950
import java.util.function.Supplier;
5051

51-
import static junit.framework.TestCase.fail;
5252
import static org.hamcrest.MatcherAssert.assertThat;
5353
import static org.hamcrest.Matchers.is;
5454
import static org.mockito.ArgumentMatchers.any;
@@ -600,7 +600,7 @@ public <K, V> void partitionsForFails() throws Exception {
600600

601601
@Override
602602
public List<PartitionInfo> result() {
603-
fail();
603+
Assertions.fail();
604604
return null;
605605
}
606606

src/test/java/io/strimzi/kafka/bridge/tracker/OffsetTrackerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import static org.hamcrest.MatcherAssert.assertThat;
2222
import static org.hamcrest.Matchers.is;
23-
import static org.junit.Assert.assertTrue;
23+
import static org.junit.jupiter.api.Assertions.assertTrue;
2424

2525
class OffsetTrackerTest {
2626

0 commit comments

Comments
 (0)