Skip to content

Commit 5ea0a53

Browse files
committed
Fix cross-language CI by auto-discovering JDK homes and setting Java 17 as default
1 parent 753c021 commit 5ea0a53

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

.github/actions/setup-environment-action/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ runs:
7474
uses: actions/setup-java@v4
7575
with:
7676
distribution: 'temurin'
77-
java-version: ${{ inputs.java-version == 'default' && '11' || inputs.java-version }}
77+
java-version: ${{ inputs.java-version == 'default' && '11\n17' || inputs.java-version }}
7878
- name: Setup Gradle
7979
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
8080
with:

buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,16 @@ class BeamModulePlugin implements Plugin<Project> {
507507

508508
project.ext.mavenGroupId = 'org.apache.beam'
509509

510+
if (!project.hasProperty('java17Home') && System.getenv('JAVA_HOME_17_X64')) {
511+
project.ext.java17Home = System.getenv('JAVA_HOME_17_X64')
512+
}
513+
if (!project.hasProperty('java11Home') && System.getenv('JAVA_HOME_11_X64')) {
514+
project.ext.java11Home = System.getenv('JAVA_HOME_11_X64')
515+
}
516+
if (!project.hasProperty('java21Home') && System.getenv('JAVA_HOME_21_X64')) {
517+
project.ext.java21Home = System.getenv('JAVA_HOME_21_X64')
518+
}
519+
510520
// Default to dash-separated directories for artifact base name,
511521
// which will also be the default artifactId for maven publications
512522
project.apply plugin: 'base'

0 commit comments

Comments
 (0)