nebula-plugins / gradle-info-plugin

Plugin to gather information about the environment
Apache License 2.0
49 stars 20 forks source link

gradle.info-java plugin does not take gradle java-toolchain into account (Build-Java-Version) when writing manifest #88

Closed devminded closed 3 years ago

devminded commented 3 years ago

Issue: "Created-By" and "Build-Java-Version" is written as the java runtime used to execute Gradle instead of the version specified in the toolchain block.

JAVA_HOME: "AdoptOpenJDK 14" Gradle: Wrapper (7.1.1)

Gradle build with:

java {
    withSourcesJar()
    toolchain {
        languageVersion = JavaLanguageVersion.of(16)
    }
}

Expected:

Created-By=16.x.x (whatever comes from tool-chain, if specified)
Build-Java-Version=16.x.x
X-Compile-Target-JDK=16
X-Compile-Source-JDK=16

Result:

Created-By=14.0.2+12 (AdoptOpenJDK)
Build-Java-Version=14.0.2
X-Compile-Target-JDK=16
X-Compile-Source-JDK=16
devminded commented 3 years ago

Wow, that was fast. 10.0.0 works like a charm. Thank you. This will make our auditors less unhappy.