Ah ha!
Here’s how I think I can solve this:
task displayJavaVersion {
doLast {
println "JDK version: ${java.toolchain.languageVersion.get().toString()}"
}
}
build.dependsOn displayJavaVersion
I can add this task to my plugin for as-needed execution and include it in the build chain like I have.