-
Notifications
You must be signed in to change notification settings - Fork 25
Description
New feature, improvement proposal
Maven Archiver defines META-INF/MANIFEST.MF entries:
Build-Jdk-SpecBuild-Jdk
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:
- adding
Build-Tool-Jdk-Specwith runtime value = [MJAR-62] Set Build-Jdk according to used toolchain maven-jar-plugin#73, - overriding
Build-Jdk-Specwith the value from the toolchain - disabling default manifest entries (which disables
Java-Versionadded in add Java-Version entry to default MANIFEST.MF #298) - ignoring
Build-Jdk: in case of toolchains usage,Build-Jdkgives full java version from Maven runtime, whileBuild-Jdk-Specgives spec of toolchain
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