Skip to content

Commit

Permalink
Allow Java21 on yarn builds (#1280)
Browse files Browse the repository at this point in the history
  • Loading branch information
reespozzi authored Nov 8, 2024
1 parent dabcc09 commit b8ff9bc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/uk/gov/hmcts/contino/YarnBuilder.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,17 @@ EOF
@Override
def setupToolVersion() {
super.setupToolVersion()
// Java required on nodejs pipeline, if data import only available as java job, but project itself is nodejs
def statusCodeJava21 = steps.sh(script: """
find . -name "build.gradle" -exec grep -l "JavaLanguageVersion.of(21)" {} + > /dev/null
""", returnStatus: true)
if (statusCodeJava21 == 0) {
def javaHomeLocation = steps.sh(script: 'ls -d /usr/lib/jvm/temurin-21-jdk-*', returnStdout: true, label: 'Detect Java location').trim()
steps.env.JAVA_HOME = javaHomeLocation
steps.env.PATH = "${steps.env.JAVA_HOME}/bin:${steps.env.PATH}"
}

localSteps.sh "java -version"
nagAboutOldNodeJSVersions()
}

Expand Down

0 comments on commit b8ff9bc

Please sign in to comment.