Skip to content

ci(windows): manually install jdk21 #5404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 25, 2025
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions buildspec/windowsTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ env:
phases:
install:
commands:
# force install java21 while we work throuh path issues
- |
$url = 'https://corretto.aws/downloads/latest/amazon-corretto-21-x64-windows-jdk.msi';
Write-Host ('Downloading from {0}' -f $url);
[ Net.ServicePointManager ]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
Invoke-WebRequest -Uri $url -OutFile 'corretto_jdk_build.msi';
Start-Process 'corretto_jdk_build.msi' -PassThru | Wait-Process;
Write-Host 'Removing ...';
Remove-Item corretto_jdk_build.msi -Force;
- |
$javaName = "C:\Program Files\Amazon Corretto" | ForEach-Object {
ls $_ | Sort-Object -Descending -Property Name | Select-Object -first 1 -expandproperty Name
}
$JAVA_HOME = "C:\Program Files\Amazon Corretto\$javaName"
- |
if(-Not($Env:CODE_COV_TOKEN -eq $null)) {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
Expand All @@ -21,6 +35,8 @@ phases:
# See https://github.com/NuGet/NuGet.Client/pull/4259
$Env:NUGET_EXPERIMENTAL_CHAIN_BUILD_RETRY_POLICY = "3,1000"

$Env:JAVA_HOME = $JAVA_HOME

if ($Env:CODEARTIFACT_DOMAIN_NAME -and $Env:CODEARTIFACT_REPO_NAME) {
$Env:CODEARTIFACT_URL=aws codeartifact get-repository-endpoint --domain $Env:CODEARTIFACT_DOMAIN_NAME --repository $Env:CODEARTIFACT_REPO_NAME --format maven --query repositoryEndpoint --output text
# $Env:CODEARTIFACT_NUGET_URL=aws codeartifact get-repository-endpoint --domain $Env:CODEARTIFACT_DOMAIN_NAME --repository $Env:CODEARTIFACT_REPO_NAME --format nuget --query repositoryEndpoint --output text
Expand Down
Loading