Skip to content

fix!: resolve Kiota JARs on the Java module path - #2267

Draft
Vincent Biret (baywet) wants to merge 2 commits into
mainfrom
draft/kiota-jpms-module-path
Draft

Vincent Biret (baywet) wants to merge 2 commits into
mainfrom
draft/kiota-jpms-module-path

Conversation

@baywet

Copy link
Copy Markdown
Member

Refs #1108 and #1224.

This draft shows the smallest runtime change for the next major version: give all eight standard JARs distinct Automatic-Module-Name values and remove the two split packages. The shared abstractions, OkHttp and bundle Java packages, and Maven/Gradle coordinates stay unchanged. There are no explicit module descriptors, so linking Kiota into a jlink image is out of scope.

Consumer migration

Affected implementation types Old package New package
Azure providers and Azure ObservabilityOptions com.microsoft.kiota.authentication com.microsoft.kiota.authentication.azure
JSON writer, parser, factories, and DefaultGsonBuilder com.microsoft.kiota.serialization com.microsoft.kiota.serialization.json
Form writer, parser, and factories com.microsoft.kiota.serialization com.microsoft.kiota.serialization.form
Text writer, parser, and factories com.microsoft.kiota.serialization com.microsoft.kiota.serialization.text
Multipart writer and factory com.microsoft.kiota.serialization com.microsoft.kiota.serialization.multipart

Update imports for moved types and rebuild; existing binaries referencing those types are not compatible. Module-path consumers must also replace requires com.microsoft.kiota with the names of the components they use. For example, JSON uses com.microsoft.kiota.serialization.json, while shared types such as Parsable are in com.microsoft.kiota.abstractions without changing their imports.

Validation and release follow-up

  • Added checkModulePath to CI to resolve the built Kiota JARs together and catch duplicate names or packages. This check covers the Kiota JARs, not an entire downstream dependency graph.
  • Before release: coordinate new serializer factory imports in the Kiota Java generator and validate a representative regenerated SDK, such as Microsoft Graph, against this runtime.

Give each runtime JAR a unique automatic module name and relocate the
Azure authentication and serializer implementations to remove split packages.

BREAKING CHANGE: Update imports and rebuild code that references the moved
Azure or serializer types. Update JPMS requires declarations for Kiota JARs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fa9184fd-1aba-42dc-a658-ac365f53a891
@baywet

Copy link
Copy Markdown
Member Author

Upgrade clarification: the Maven/Gradle dependency coordinates (groupId and artifactId) stay the same. Consumers do not need to rename dependencies in pom.xml or build.gradle; they only bump the version there.

For classpath consumers, the breaking change is limited to Java code that references the moved Azure authentication or serializer classes: update the imports and rebuild. The Kiota Java generator also needs to emit the new serializer factory imports so regenerated SDKs compile against the new runtime. Consumers using JPMS additionally need to update the relevant requires declarations in module-info.java.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.

…ota-jpms-module-path

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Conflicts have been resolved. A maintainer will take a look shortly.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants