Skip to content

build: add Automatic-Module-Name to zai-sdk for Java 9+ module support#82

Merged
tomsun28 merged 2 commits intozai-org:mainfrom
OblivRuinDev:patch-1
Feb 27, 2026
Merged

build: add Automatic-Module-Name to zai-sdk for Java 9+ module support#82
tomsun28 merged 2 commits intozai-org:mainfrom
OblivRuinDev:patch-1

Conversation

@OblivRuinDev
Copy link
Contributor

Description

Add entry Automatic-Module-Name: ai.z.openapi.sdk in 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

Fixes #<issue_number>

Add or Update API

  • I have added the necessary test case and all cases have passed.

@OblivRuinDev
Copy link
Contributor Author

OblivRuinDev commented Feb 12, 2026

Should update version number and publish sdk to maven central?
You own write premission, can add new commits to patch-1 branch.
应该更新版本号并发布sdk到Maven Central吗
你拥有写权限,可以在当前分支(patch-1)上添加commit

@OblivRuinDev
Copy link
Contributor Author

OblivRuinDev commented Feb 20, 2026

Note that I don't know whether the Automic-Module-Name should be "ai.z.openapi" or "ai.z.openapi.sdk".
注意,我不确定模块名(Automic-Module-Name)应该为“ai.z.openapi”还是“ai.z.openapi.sdk”

@tomsun28
Copy link
Member

thanks for this, we will review and test it.

Copy link

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

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.sdk to the JAR manifest for the core (zai-sdk) module via maven-jar-plugin.
  • Add a note in the root pom.xml indicating that maven-jar-plugin changes should be kept in sync with core/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.

Copy link
Member

@tomsun28 tomsun28 left a comment

Choose a reason for hiding this comment

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

LGTM!thanks.

@tomsun28 tomsun28 merged commit 07f3e38 into zai-org:main Feb 27, 2026
7 checks passed
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.

3 participants