Add explicit Java module descriptor#204
Conversation
Co-authored-by: brunoborges <[email protected]>
|
Thanks, @brunoborges . This is a good one. I look forward to getting it merged. |
There was a problem hiding this comment.
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.javadeclaringmodule com.github.copilot.sdk.javawith required Jackson modules and exports for the four public SDK packages. - New
ModuleDescriptorTestasserting the SDK is loaded as a named module with the expected exports andrequiresentries. - 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.httpis declared as arequires staticdependency, but no class undersrc/main/javareferences thejava.net.httppackage (searches forHttpClientandjava.net.httpreturn no usages outside this module descriptor). Consider removing thisrequiresto 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
Co-authored-by: edburns <[email protected]>
Co-authored-by: edburns <[email protected]>
Fixed in d2ea79a. I investigated the latest failing Build & Test run (25941165931) and updated |
…regenerate Co-authored-by: edburns <[email protected]>
Before the change?
After the change?
module com.github.copilot.sdk.javawith SDK package exports and required module dependencies.module-info.java.Pull request checklist
mvn spotless:applyhas been run to format the codemvn clean verifypasses locallyDoes this introduce a breaking change?