[Build] Fix java macos by tianleiwu · Pull Request #27271 · microsoft/onnxruntime

added 3 commits

February 5, 2026 20:32

@tianleiwu

@tianleiwu

eserscor

tianleiwu added a commit that referenced this pull request

Feb 12, 2026
### Description

This PR restores Java support on macOS arm64 and fixes Jar testing
failures on the new AcesShared pool.

#### Background

Commit `5ed340f7a51f3cbdb62577a874daf2b3f23d6a93`
(#26252) moved macOS builds
to a faster pool (AcesShared) which reduced build time by 85%, but this
pool doesn't have JDK installed and ADO's `JavaToolInstaller` doesn't
support macOS. As a result, Java binaries for macOS arm64 were
temporarily removed.

#### Changes

1. Enable Java Builds & Tests on macOS ARM64:
* Install JDK 17: Added a script to install JDK 17 via Homebrew if
missing on the agent.
* Install Maven: Added a fallback to install Maven using curl (since
wget is missing on macOS) and configured it to use the * dynamically
resolved JAVA_HOME.
* Pipeline Updates: Updated jar_package_testing.yml and
final-jar-testing-linux.yml to run correctly on AcesShared.
2. Fix C API Tests on macOS ARM64:
* Pool Migration: Updated c-api-noopenmp-test-pipelines.yml to use
AcesShared with the correct ImageOverride.
* Template Enhancements: Updated nuget/templates/test_macos.yml to
support dynamic AgentPool and PoolDemands.
* Fix Missing Artifact: Modified mac-cpu-packaging-steps.yml to
explicitly copy libcustom_op_library.dylib into the testdata folder of
the artifact, resolving DllNotFoundException in EndToEndTests.

### Motivation and Context

To ensure robust CI coverage for macOS ARM64 (Apple Silicon) for both
Java and C APIs effectively using the efficient AcesShared pool.

### Testing

- Final_Jar_Testing_MacOS passed: 

https://dev.azure.com/aiinfra/Lotus/_build/results?buildId=1081961&view=logs&j=f1f8e11e-a9fa-53e5-cd29-3ba2c1988550&t=f4fafe98-de38-519c-0045-d220f6898d47

tianleiwu added a commit that referenced this pull request

Feb 13, 2026
This cherry-picks the following commits for the 1.24.2 release:
- #27096
- #27077
- #26677
- #27238
- #27213
- #27256
- #27278
- #27275
- #27276
- #27216
- #27271
- #27299
- #27294
- #27266
- #27176
- #27126
- #27252

---------

Co-authored-by: Xiaofei Han <xiaofeihan@microsoft.com>
Co-authored-by: Jiajia Qin <jiajiaqin@microsoft.com>
Co-authored-by: Yulong Wang <7679871+fs-eire@users.noreply.github.com>
Co-authored-by: qti-monumeen <monumeen@qti.qualcomm.com>
Co-authored-by: Ankit Maheshkar <ankit.maheshkar@intel.com>
Co-authored-by: Eric Crawford <eric.r.crawford@intel.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: guschmue <22941064+guschmue@users.noreply.github.com>
Co-authored-by: Guenther Schmuelling <guschmue@microsoft.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: angelser <32746004+angelser@users.noreply.github.com>
Co-authored-by: Angela Serrano Brummett <angelser@microsoft.com>
Co-authored-by: Misha Chornyi <99709299+mc-nv@users.noreply.github.com>
Co-authored-by: hariharans29 <9969784+hariharans29@users.noreply.github.com>
Co-authored-by: eserscor <erscor@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Baiju Meswani <bmeswani@microsoft.com>
Co-authored-by: Adrian Lizarraga <adlizarraga@microsoft.com>
Co-authored-by: Ti-Tai Wang <titaiwang@microsoft.com>
Co-authored-by: bmehta001 <bmehta001@users.noreply.github.com>

This was referenced

Feb 23, 2026