Skip to content

Commit

Permalink
ci(windows): manually install jdk21 (#5404)
Browse files Browse the repository at this point in the history
as of feb 24, 2025, codebuild has java8 first in PATH which causes gradle to fail because we require 21

this is the same hack previously used for 223
https://github.com/aws/aws-toolkit-jetbrains/blob/162acabc3809f737684257903c9b72a4273c4850/buildspec/windowsTests.yml
  • Loading branch information
rli authored Feb 25, 2025
1 parent f8fa131 commit a6fb33c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions buildspec/windowsTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ env:
phases:
install:
commands:
# force install java21 while we work throuh path issues
- |
$javaName = "C:\Program Files\Amazon Corretto" | ForEach-Object {
ls $_ | Where-Object {$_ -Like "jdk*"} | 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 +27,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
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class AwsSdkClientTest {
val selfSignedJks = AwsSdkClientTest::class.java.getResource("/selfSigned.jks")
return WireMockRule(
wireMockConfig()
.httpDisabled(true)
.dynamicHttpsPort()
.keystorePath(selfSignedJks.toString())
.keystorePassword("changeit")
Expand Down

0 comments on commit a6fb33c

Please sign in to comment.