diff --git a/modules/services/event-history-service/pom.xml b/modules/services/event-history-service/pom.xml
index b1483ca3..7932ff45 100644
--- a/modules/services/event-history-service/pom.xml
+++ b/modules/services/event-history-service/pom.xml
@@ -28,10 +28,6 @@
com.lingniu.ingest
protocol-gb32960
-
- org.apache.kafka
- kafka-clients
-
org.springframework.boot
spring-boot-starter-web
diff --git a/modules/services/event-history-service/src/test/java/com/lingniu/ingest/eventhistory/config/EventHistoryPomBoundaryTest.java b/modules/services/event-history-service/src/test/java/com/lingniu/ingest/eventhistory/config/EventHistoryPomBoundaryTest.java
index 96e79384..095d2248 100644
--- a/modules/services/event-history-service/src/test/java/com/lingniu/ingest/eventhistory/config/EventHistoryPomBoundaryTest.java
+++ b/modules/services/event-history-service/src/test/java/com/lingniu/ingest/eventhistory/config/EventHistoryPomBoundaryTest.java
@@ -21,11 +21,31 @@ class EventHistoryPomBoundaryTest {
.doesNotContain("com.taosdata.jdbc:taos-jdbcdriver");
}
+ @Test
+ void kafkaClientsIsOwnedBySinkMqModule() throws Exception {
+ for (Path pom : servicePoms()) {
+ assertThat(directDependencies(readPom(pom)))
+ .as(pom.toString())
+ .doesNotContain("org.apache.kafka:kafka-clients");
+ }
+ }
+
private static Document modulePom() throws Exception {
+ return readPom(repositoryRoot().resolve("modules/services/event-history-service/pom.xml"));
+ }
+
+ private static Document readPom(Path pom) throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
- return factory.newDocumentBuilder().parse(Files.newInputStream(repositoryRoot()
- .resolve("modules/services/event-history-service/pom.xml")));
+ return factory.newDocumentBuilder().parse(Files.newInputStream(pom));
+ }
+
+ private static List servicePoms() {
+ Path services = repositoryRoot().resolve("modules/services");
+ return List.of(
+ services.resolve("event-history-service/pom.xml"),
+ services.resolve("vehicle-state-service/pom.xml"),
+ services.resolve("vehicle-stat-service/pom.xml"));
}
private static List directDependencies(Document pom) {
diff --git a/modules/services/vehicle-stat-service/pom.xml b/modules/services/vehicle-stat-service/pom.xml
index 0209f0ba..28c1268f 100644
--- a/modules/services/vehicle-stat-service/pom.xml
+++ b/modules/services/vehicle-stat-service/pom.xml
@@ -16,10 +16,6 @@
com.lingniu.ingest
sink-mq
-
- org.apache.kafka
- kafka-clients
-
org.springframework.boot
spring-boot-autoconfigure
diff --git a/modules/services/vehicle-state-service/pom.xml b/modules/services/vehicle-state-service/pom.xml
index c3279287..0413b743 100644
--- a/modules/services/vehicle-state-service/pom.xml
+++ b/modules/services/vehicle-state-service/pom.xml
@@ -16,10 +16,6 @@
com.lingniu.ingest
sink-mq
-
- org.apache.kafka
- kafka-clients
-
org.springframework.boot
spring-boot-starter-data-redis