From 0304ae3097c9c70790d989762a431786684c52d5 Mon Sep 17 00:00:00 2001 From: Vikentiy Fesunov Date: Tue, 11 Aug 2026 20:10:06 +0200 Subject: [PATCH] Add java module system declarations Core is in Java 7, so it can only have automatic module name, set via jar manifest. Forwarder gets a real declaration, which declares a transitive dependency on the core package. One wrinkle is that this breaks `mvn test`: automatic module name is only added to the packaged jar, which is not built when running tests, and then the forwarder tests are unable to find core module and fail. `mvn package` is a workaround, since it also builds jar for core, which is then used to run forwarder tests. --- dogstatsd-http/core/pom.xml | 14 ++++++++++++++ .../forwarder/src/main/java/module-info.java | 15 +++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 dogstatsd-http/forwarder/src/main/java/module-info.java diff --git a/dogstatsd-http/core/pom.xml b/dogstatsd-http/core/pom.xml index 271173e3..fc4fe501 100644 --- a/dogstatsd-http/core/pom.xml +++ b/dogstatsd-http/core/pom.xml @@ -39,6 +39,20 @@ maven-surefire-plugin 2.19 + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + + + com.datadoghq.dogstatsd.http + + + + diff --git a/dogstatsd-http/forwarder/src/main/java/module-info.java b/dogstatsd-http/forwarder/src/main/java/module-info.java new file mode 100644 index 00000000..c1ee574a --- /dev/null +++ b/dogstatsd-http/forwarder/src/main/java/module-info.java @@ -0,0 +1,15 @@ +/* Unless explicitly stated otherwise all files in this repository are + * licensed under the Apache 2.0 License. + * + * This product includes software developed at Datadog + * (https://www.datadoghq.com/) Copyright 2026 Datadog, Inc. + */ + +/** HTTP forwarder for DogStatsD metrics. */ +module com.datadoghq.dogstatsd.http.forwarder { + requires transitive com.datadoghq.dogstatsd.http; + requires java.net.http; + requires java.logging; + + exports com.datadoghq.dogstatsd.http.forwarder; +}