1.7 KiB
1.7 KiB
Task 03: Complete JDK version handling in onlyPushtoJfrog.groovy
- Type: Small feature
- Source:
BUGS_AND_IMPROVEMENTS_REPORT.md§1.5
Goal
When a user picks JDK 11 or JDK 21 in the onlyPushtoJfrog choice parameter, the job runs under that JDK — not the JDK 8 fall-through default.
Acceptance Criteria
vars/onlyPushtoJfrog.groovy:16choice parameter remains['jdk8', 'jdk11', 'jdk17', 'jdk21'](no values removed)- The if/else at
vars/onlyPushtoJfrog.groovy:48-53handles all four JDK selections, each setting the correctJAVA_HOMEpath that exists in the build-tools pod image - An unknown JDK selection (shouldn't happen via the choice param, but defensive) sets
JAVA_HOMEto a fail-fast value and logslog.error("Unknown jdk_version: ${jdk_version}")instead of silently defaulting to JDK 8 - Verify the JDK paths against the actual
devops-tools:lunar-vX.Y.Zimage used byprd-pod.yaml/stg-pod.yaml. Ifjdk11orjdk21aren't in the image, raise atribal-knowledge §12follow-up (bump the build-tools image tag) before this task can complete - Smoke-test all 4 JDK selections via a sandbox Jenkins job — confirm
java -versionreports the expected JDK in each run - No behavioural change for
jdk8/jdk17selections — those branches stay identical
Notes / known gotchas
- The fall-through bug is silent: builds "succeed" with the wrong JDK, which can mask bytecode-version incompatibilities or break records of which JDK actually built the artifact. The fail-fast on unknown values is intentional.
tribal-knowledge.md§12 calls out that toolchain binaries belong in the pod image, not curled at build time — keep this task aligned with that convention.