Skip to content

Add java module system declarations - #333

Merged
vickenty merged 2 commits into
masterfrom
vickenty/dhm
Aug 12, 2026
Merged

Add java module system declarations#333
vickenty merged 2 commits into
masterfrom
vickenty/dhm

Conversation

@vickenty

Copy link
Copy Markdown
Contributor

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.

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.
@vickenty
vickenty marked this pull request as ready for review August 12, 2026 07:40
@vickenty
vickenty requested a review from a team as a code owner August 12, 2026 07:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0304ae3097

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".


/** HTTP forwarder for DogStatsD metrics. */
module com.datadoghq.dogstatsd.http.forwarder {
requires transitive com.datadoghq.dogstatsd.http;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make the core module resolvable before package

When the dogstatsd-http reactor is built only through compile/test (for example mvn test), this requires asks javac for com.datadoghq.dogstatsd.http, but that name only exists in the core artifact's packaged JAR manifest via Automatic-Module-Name; before the package phase Maven has only core's target/classes, which has no module descriptor or manifest, so the forwarder compile fails with module not found. This leaves the standard test workflow broken unless developers remember to run a later lifecycle phase first.

Useful? React with 👍 / 👎.

@vickenty vickenty Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix for this is to add module-info.java, which is Java 9+ and doesn't work on Java 7. Someday.

@vickenty
vickenty merged commit 1440a93 into master Aug 12, 2026
21 checks passed
@vickenty
vickenty deleted the vickenty/dhm branch August 12, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants