From c176727c9fdeeb632e954bc8cfcfb44c764c018d Mon Sep 17 00:00:00 2001 From: wenytang-ms Date: Mon, 21 Sep 2026 10:51:03 +0800 Subject: [PATCH 1/2] fix: download JDK 25 in CI --- .azure-pipelines/ci.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml index be27833b..547a851c 100644 --- a/.azure-pipelines/ci.yml +++ b/.azure-pipelines/ci.yml @@ -61,12 +61,24 @@ extends: steps: - checkout: self fetchTags: false + # The image does not have jdk preinstalled, we need to download it first. + - task: PowerShell@2 + displayName: Download JDK 25 + inputs: + targetType: 'inline' + script: |- + New-Item -ItemType Directory -Path "$env:AGENT_TEMPDIRECTORY\downloadjdk" + Invoke-WebRequest -Uri "https://aka.ms/download-jdk/microsoft-jdk-25-windows-x64.zip" -OutFile "$env:AGENT_TEMPDIRECTORY\downloadjdk\microsoft-jdk-25-windows-x64.zip" - task: JavaToolInstaller@0 displayName: Use Java 25 inputs: versionSpec: "25" jdkArchitectureOption: x64 - jdkSourceOption: PreInstalled + jdkSourceOption: LocalDirectory + jdkFile: $(Agent.TempDirectory)/downloadjdk/microsoft-jdk-25-windows-x64.zip + jdkDestinationDirectory: $(Agent.ToolsDirectory)/ms-jdk25 + - script: java --version + displayName: 'Check Java installation' - task: NodeTool@0 displayName: Use Node 20.x inputs: @@ -93,12 +105,24 @@ extends: steps: - checkout: self fetchTags: false + # The image does not have jdk preinstalled, we need to download it first. + - task: PowerShell@2 + displayName: Download JDK 25 + inputs: + targetType: 'inline' + script: |- + New-Item -ItemType Directory -Path "$env:AGENT_TEMPDIRECTORY\downloadjdk" + Invoke-WebRequest -Uri "https://aka.ms/download-jdk/microsoft-jdk-25-windows-x64.zip" -OutFile "$env:AGENT_TEMPDIRECTORY\downloadjdk\microsoft-jdk-25-windows-x64.zip" - task: JavaToolInstaller@0 displayName: Use Java 25 inputs: versionSpec: "25" jdkArchitectureOption: x64 - jdkSourceOption: PreInstalled + jdkSourceOption: LocalDirectory + jdkFile: $(Agent.TempDirectory)/downloadjdk/microsoft-jdk-25-windows-x64.zip + jdkDestinationDirectory: $(Agent.ToolsDirectory)/ms-jdk25 + - script: java --version + displayName: 'Check Java installation' - task: NodeTool@0 displayName: Use Node 20.x inputs: From 5eb0b1438d3b21b58d291dfff55757118954a1e1 Mon Sep 17 00:00:00 2001 From: wenytang-ms Date: Mon, 21 Sep 2026 11:03:23 +0800 Subject: [PATCH 2/2] fix: use Linux JDK archive in CI --- .azure-pipelines/ci.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml index 547a851c..ae84d112 100644 --- a/.azure-pipelines/ci.yml +++ b/.azure-pipelines/ci.yml @@ -62,20 +62,22 @@ extends: - checkout: self fetchTags: false # The image does not have jdk preinstalled, we need to download it first. - - task: PowerShell@2 + - task: Bash@3 displayName: Download JDK 25 inputs: - targetType: 'inline' + targetType: inline script: |- - New-Item -ItemType Directory -Path "$env:AGENT_TEMPDIRECTORY\downloadjdk" - Invoke-WebRequest -Uri "https://aka.ms/download-jdk/microsoft-jdk-25-windows-x64.zip" -OutFile "$env:AGENT_TEMPDIRECTORY\downloadjdk\microsoft-jdk-25-windows-x64.zip" + mkdir -p "$(Agent.TempDirectory)/downloadjdk" + curl --fail --location --silent --show-error \ + "https://aka.ms/download-jdk/microsoft-jdk-25-linux-x64.tar.gz" \ + --output "$(Agent.TempDirectory)/downloadjdk/microsoft-jdk-25-linux-x64.tar.gz" - task: JavaToolInstaller@0 displayName: Use Java 25 inputs: versionSpec: "25" jdkArchitectureOption: x64 jdkSourceOption: LocalDirectory - jdkFile: $(Agent.TempDirectory)/downloadjdk/microsoft-jdk-25-windows-x64.zip + jdkFile: $(Agent.TempDirectory)/downloadjdk/microsoft-jdk-25-linux-x64.tar.gz jdkDestinationDirectory: $(Agent.ToolsDirectory)/ms-jdk25 - script: java --version displayName: 'Check Java installation' @@ -106,20 +108,22 @@ extends: - checkout: self fetchTags: false # The image does not have jdk preinstalled, we need to download it first. - - task: PowerShell@2 + - task: Bash@3 displayName: Download JDK 25 inputs: - targetType: 'inline' + targetType: inline script: |- - New-Item -ItemType Directory -Path "$env:AGENT_TEMPDIRECTORY\downloadjdk" - Invoke-WebRequest -Uri "https://aka.ms/download-jdk/microsoft-jdk-25-windows-x64.zip" -OutFile "$env:AGENT_TEMPDIRECTORY\downloadjdk\microsoft-jdk-25-windows-x64.zip" + mkdir -p "$(Agent.TempDirectory)/downloadjdk" + curl --fail --location --silent --show-error \ + "https://aka.ms/download-jdk/microsoft-jdk-25-linux-x64.tar.gz" \ + --output "$(Agent.TempDirectory)/downloadjdk/microsoft-jdk-25-linux-x64.tar.gz" - task: JavaToolInstaller@0 displayName: Use Java 25 inputs: versionSpec: "25" jdkArchitectureOption: x64 jdkSourceOption: LocalDirectory - jdkFile: $(Agent.TempDirectory)/downloadjdk/microsoft-jdk-25-windows-x64.zip + jdkFile: $(Agent.TempDirectory)/downloadjdk/microsoft-jdk-25-linux-x64.tar.gz jdkDestinationDirectory: $(Agent.ToolsDirectory)/ms-jdk25 - script: java --version displayName: 'Check Java installation'