melix / jmh-gradle-plugin

Integrates the JMH benchmarking framework with Gradle
Apache License 2.0
659 stars 88 forks source link

Manifest of shaded jar lacks multi-release header #233

Open marschall opened 1 year ago

marschall commented 1 year ago

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