Skip to content

Improve Java emitter Maven CI builds - #12752

Merged
Alan Zimmer (alzimmermsft) merged 4 commits into
microsoft:mainfrom
alzimmermsft:alzimmermsft-java-ci-maven-caching
Dec 4, 2026
Merged

Alan Zimmer (alzimmermsft) merged 4 commits into
microsoft:mainfrom
alzimmermsft:alzimmermsft-java-ci-maven-caching

Conversation

@alzimmermsft

@alzimmermsft Alan Zimmer (alzimmermsft) commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Cache Maven dependencies in Java CI by OS and parent POM, use parallel builds without transfer progress, and limit Maven CI logging to warnings and errors.
  • Centralize Maven dependency versions in the parent POM and target Java 17; reject older runtimes before launching the generator.
  • Streamline regeneration and Spector setup to package the generator JAR without test compilation/execution, test-resource copying, Spotless, or Maven installation. Generated-project smoke checks remain enabled.
  • Shared emitter pipeline templates are unchanged; Java keeps the separate Build and Test stages.

Validation

  • Full Java package build, generator unit tests, emitter tests, and both Azure and ClientCore Spector suites passed locally.
  • Lean generator packaging and PowerShell build/test orchestration checks passed, including fail-fast behavior.
  • Emitter lint/typecheck, Maven Spotless, repository formatting, and CSpell on changed files passed.
  • Azure Pipelines cache behavior and end-to-end template execution have not been verified in CI.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • ✅ @typespec/http-client-java
Show changes

@typespec/http-client-java - internal ✏️

Streamline Java regeneration and Spector setup builds, centralize Maven dependency versions, and target Java 17.

@typespec/http-client-java - fix ✏️

Reject Java runtimes older than Java 17 before launching the generator.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The Java 17 target leaves validation accepting Java 11–16, causing an UnsupportedClassVersionError reported as an unknown error instead of a clear SDK dependency diagnostic.

1 open issue
What changed in this PR

Improves Maven CI efficiency for the Java emitter and centralizes its generator build configuration.

Changes:

  • Adds OS- and parent-POM-keyed Maven caching.
  • Enables parallel, quieter Maven commands.
  • Centralizes dependency and plugin versions and targets Java 17.
File Description
packages/​http-client-java/​generator/​pom.xml Centralizes versions and sets Java 17 compilation.
packages/​http-client-java/​generator/​http-client-generator/​pom.xml Inherits dependency and Shade plugin versions.
packages/​http-client-java/​generator/​http-client-generator-test/​pom.xml Inherits test dependency versions and exclusions.
packages/​http-client-java/​generator/​http-client-generator-mgmt/​pom.xml Inherits management generator dependency versions.
packages/​http-client-java/​generator/​http-client-generator-core/​pom.xml Inherits core dependency and plugin configuration.
packages/​http-client-java/​generator/​http-client-generator-clientcore-test/​pom.xml Inherits ClientCore test dependency versions.
packages/​http-client-java/​generator/​http-client-generator-clientcore-test/​Generate.ps1 Uses parallel, quieter smoke-test builds.
packages/​http-client-java/​eng/​scripts/​Build-Packages.ps1 Runs parallel, quieter formatting checks.
packages/​http-client-java/​eng/​pipeline/​templates/​ci-stages.yml Configures Maven repository caching.
.chronus/​changes/​alzimmermsft-java-ci-maven-caching-2026-11-4-12-25-55.md Records the internal build changes.

Review effort: Balanced

@azure-sdk-automation

azure-sdk-automation Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

Reuse the generator build for Spector testing, streamline regeneration packaging, limit Maven CI logging, and require Java 17 before generator execution.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

End-to-end template execution and Maven cache behavior remain unverified for the shared pipeline changes, requiring Windows and Linux CI runs before approval.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Revert the combined Build and Test stage and fix spelling in Java CI configuration.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings December 4, 2026 18:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Build and Test share an immutable cache key, preventing Test jobs from saving test-only dependencies and forcing repeated downloads on every run.

1 open issue

Review effort: Balanced

@alzimmermsft
Alan Zimmer (alzimmermsft) added this pull request to the merge queue Dec 4, 2026
Merged via the queue into microsoft:main with commit e6d9bf4 Dec 4, 2026
44 checks passed
@alzimmermsft
Alan Zimmer (alzimmermsft) deleted the alzimmermsft-java-ci-maven-caching branch December 4, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:java Issue for the Java client emitter: @typespec/http-client-java eng

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants