jmh-gradle-plugin icon indicating copy to clipboard operation
jmh-gradle-plugin copied to clipboard

Manifest of shaded jar lacks multi-release header

Open marschall opened this issue 2 years ago • 0 comments

Describe the bug The manifest of the JMH jar containing the JMH runtime and the compiled benchmark classes lacks a Multi-Release header when one of the dependencies is a multi-release JAR. This makes the JMH jar no longer a multi-release JAR, thus disables the multi-release mechanism, thus breaking these dependencies.

To Reproduce Steps to reproduce the behavior:

  1. Add a dependency to a multi-release JAR. eg. ch.randelshofer:fastdoubleparser:0.5.4
  2. Build the JMH jar.
  3. Look at the manifest of the JMH jar, eg. unzip -q -c build/libs/${artifact}-${version}-jmh.jar META-INF/MANIFEST.MF

The manifest looks like this

Manifest-Version: 1.0
Main-Class: org.openjdk.jmh.Main

It lacks a multi-release entry

Multi-Release: true

marschall avatar Dec 21 '22 08:12 marschall