build: add Automatic-Module-Name to zai-sdk for Java 9+ module support#82
build: add Automatic-Module-Name to zai-sdk for Java 9+ module support#82tomsun28 merged 2 commits intozai-org:mainfrom
Conversation
|
Should update version number and publish sdk to maven central? |
|
Note that I don't know whether the Automic-Module-Name should be "ai.z.openapi" or "ai.z.openapi.sdk". |
|
thanks for this, we will review and test it. |
There was a problem hiding this comment.
Pull request overview
This PR adds Java 9+ module-system friendliness for the zai-sdk artifact by embedding a stable Automatic-Module-Name into the generated JAR manifest.
Changes:
- Add
Automatic-Module-Name: ai.z.openapi.sdkto the JAR manifest for thecore(zai-sdk) module viamaven-jar-plugin. - Add a note in the root
pom.xmlindicating thatmaven-jar-pluginchanges should be kept in sync withcore/pom.xml.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pom.xml | Adds a reminder comment to keep jar-plugin configuration aligned with the core module. |
| core/pom.xml | Configures maven-jar-plugin to emit Automatic-Module-Name in the built SDK JAR manifest. |
Comments suppressed due to low confidence (1)
core/pom.xml:203
- core/pom.xml now duplicates the parent maven-jar-plugin configuration (Implementation-* manifest entries) just to add Automatic-Module-Name. This creates a drift risk (the parent pom even notes that changes should be kept in sync). Consider inheriting the parent jar-plugin config and only specifying the additional Automatic-Module-Name entry here (or moving shared config into and overriding only the extra manifest entry in this module).
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration>
<archive>
<manifestEntries>
<Implementation-Title>${project.artifactId}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Automatic-Module-Name>ai.z.openapi.sdk</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Add entry
Automatic-Module-Name: ai.z.openapi.sdkin MANIFEST.MF to add support for Java 9+ module system通过在文件MANIFEST.MF中添加条目
Automatic-Module-Name: ai.z.openapi.sdk来向Java 9+模块系统添加支持否则在Java 9+的模块化项目使用此SDK将造成各种模块找不到的错误
Checklist
CONTRIBUTINGGuide.mvn clean testfrom the repository root)Fixes #<issue_number>
Add or Update API