Adapt BWC Java selection logic
On older branches we build using Oracle Java and on newer branches we
build using OpenJDK. This commit adapts the BWC Java version selection
logic to be more flexible and account for both of these situations.
@@ -145,8 +145,8 @@ bwcVersions.forPreviousUnreleased { VersionCollection.UnreleasedVersionInfo unre
'JAVA_HOME',
getJavaHome(it, Integer.parseInt(
lines
- .findAll({ it.startsWith("ES_BUILD_JAVA=openjdk") })
- .collect({ it.replace("ES_BUILD_JAVA=openjdk", "").trim() })
+ .findAll({ it.startsWith("ES_BUILD_JAVA=java") || it.startsWith("ES_BUILD_JAVA=openjdk") })
+ .collect({ it.replace("ES_BUILD_JAVA=java", "").replace("ES_BUILD_JAVA=openjdk", "").trim() })
.join("!!")
))
)
