New feature, improvement proposal
Maven Archiver defines META-INF/MANIFEST.MF entries:
they are taken from Maven runtime: when a JDK toochain is used, we need clarity between JDK/JRE running Maven (the build tool) vs JDK for compiling (running the compiler)
Build-Jdkand Build-Jdk-Spec in spirit are more about he compiler than Maven runtime
Build-Tool-Jdk-Spec (or Jre?) should give the Java version used by Maven build tool runtime, at least when toolchains is used, perhaps also when toolchains are not used, just to start giving good habits of not always considering they are the same
And perhaps do the equivalent for Build-Tool-Jdk
Existing solution in Maven Jar Plugin
this has been partially done in Maven Jar Plugin 3.4.0 MJAR-62:
this algorithm would be better implemented in Maven Archiver, with the plugin just configuring the toolchain to Maven Archiver: then Maven Archiver can use the toolchain
this would probably also be a good first step to injecting later the toolchain to Plexus Module Archiver that seems to be necessary given failure described in apache/maven-jar-plugin#439
New feature, improvement proposal
Maven Archiver defines
META-INF/MANIFEST.MFentries:Build-Jdk-SpecBuild-Jdkthey are taken from Maven runtime: when a JDK toochain is used, we need clarity between JDK/JRE running Maven (the build tool) vs JDK for compiling (running the compiler)
Build-JdkandBuild-Jdk-Specin spirit are more about he compiler than Maven runtimeBuild-Tool-Jdk-Spec(orJre?) should give the Java version used by Maven build tool runtime, at least when toolchains is used, perhaps also when toolchains are not used, just to start giving good habits of not always considering they are the sameAnd perhaps do the equivalent for
Build-Tool-JdkExisting solution in Maven Jar Plugin
this has been partially done in Maven Jar Plugin 3.4.0 MJAR-62:
Build-Tool-Jdk-Specwith runtime value = [MJAR-62] Set Build-Jdk according to used toolchain maven-jar-plugin#73,Build-Jdk-Specwith the value from the toolchainJava-Versionadded in add Java-Version entry to default MANIFEST.MF #298)Build-Jdk: in case of toolchains usage,Build-Jdkgives full java version from Maven runtime, whileBuild-Jdk-Specgives spec of toolchainthis algorithm would be better implemented in Maven Archiver, with the plugin just configuring the toolchain to Maven Archiver: then Maven Archiver can use the toolchain
this would probably also be a good first step to injecting later the toolchain to Plexus Module Archiver that seems to be necessary given failure described in apache/maven-jar-plugin#439