Skip to content

Add explicit Java module descriptor#204

Merged
edburns merged 4 commits into
mainfrom
copilot/support-java-modularity
May 15, 2026
Merged

Add explicit Java module descriptor#204
edburns merged 4 commits into
mainfrom
copilot/support-java-modularity

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026


Before the change?

  • The SDK only published an automatic module name, so JPMS consumers did not get an explicit module descriptor.

After the change?

  • Adds module com.github.copilot.sdk.java with SDK package exports and required module dependencies.
  • Adds coverage that verifies the SDK is loaded as a named module with expected exports.
  • Updates Checkstyle configuration to skip module-info.java.
module com.github.copilot.sdk.java {
    exports com.github.copilot.sdk;
    exports com.github.copilot.sdk.generated;
    exports com.github.copilot.sdk.generated.rpc;
    exports com.github.copilot.sdk.json;
}

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • mvn spotless:apply has been run to format the code
  • mvn clean verify passes locally

Does this introduce a breaking change?

  • Yes
  • No

Copilot AI linked an issue May 15, 2026 that may be closed by this pull request
1 task
Co-authored-by: brunoborges <[email protected]>
Copilot AI changed the title [WIP] Add support for explicit module name in Java library Add explicit Java module descriptor May 15, 2026
Copilot AI requested a review from brunoborges May 15, 2026 17:58
@edburns
Copy link
Copy Markdown
Collaborator

edburns commented May 15, 2026

Thanks, @brunoborges . This is a good one. I look forward to getting it merged.

@brunoborges brunoborges marked this pull request as ready for review May 15, 2026 19:05
Copilot AI review requested due to automatic review settings May 15, 2026 19:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an explicit JPMS module descriptor (module-info.java) so consumers of the SDK get a real named module instead of just an Automatic-Module-Name. A unit test verifies the module name, exports, and Jackson dependency, and Checkstyle is updated to exclude module-info.java from documentation rules.

Changes:

  • New src/main/java/module-info.java declaring module com.github.copilot.sdk.java with required Jackson modules and exports for the four public SDK packages.
  • New ModuleDescriptorTest asserting the SDK is loaded as a named module with the expected exports and requires entries.
  • Checkstyle filter pattern updated to also skip module-info.java.
Show a summary per file
File Description
src/main/java/module-info.java New JPMS descriptor declaring requires/exports for the SDK.
src/test/java/com/github/copilot/sdk/ModuleDescriptorTest.java Verifies module is named and exposes expected packages/requires.
config/checkstyle/checkstyle.xml Excludes module-info.java from Checkstyle (alongside existing package excludes).

Copilot's findings

Comments suppressed due to low confidence (1)

src/main/java/module-info.java:15

  • java.net.http is declared as a requires static dependency, but no class under src/main/java references the java.net.http package (searches for HttpClient and java.net.http return no usages outside this module descriptor). Consider removing this requires to keep the descriptor accurate; otherwise readers will be misled about the SDK's compile-time dependencies.
    requires static java.net.http;
  • Files reviewed: 3/3 changed files
  • Comments generated: 1

Comment thread src/main/java/module-info.java
Copilot AI requested a review from edburns May 15, 2026 21:02
Copy link
Copy Markdown
Collaborator

@edburns edburns left a comment

Choose a reason for hiding this comment

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

@copilot I observe the Build & Test workflow failed. This must not fail. Please investigate the most recent failures and fix them, pushing more commits.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 15, 2026

@copilot I observe the Build & Test workflow failed. This must not fail. Please investigate the most recent failures and fix them, pushing more commits.

Fixed in d2ea79a. I investigated the latest failing Build & Test run (25941165931) and updated module-info.java to open com.github.copilot.sdk, com.github.copilot.sdk.generated, and com.github.copilot.sdk.json to com.fasterxml.jackson.databind, which resolves the JPMS/Jackson InaccessibleObjectException test failures.

Copilot AI requested a review from edburns May 15, 2026 22:09
@edburns edburns merged commit 9a7ba4c into main May 15, 2026
10 checks passed
@edburns edburns deleted the copilot/support-java-modularity branch May 15, 2026 22:20
Copilot AI added a commit that referenced this pull request May 15, 2026
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.

[FEAT]: Support for Java Modularity

4 participants