This is a workaround for the situation where the following error occurs with JMH Gradle Plugin
( me.champeau.gradle.jmh
).
> Task :jmh FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':jmh'.
> A failure occurred while executing me.champeau.gradle.IsolatedRunner
> Error during execution of benchmarks
In my case, it was due to the benchmark-related directory structure.
As listed in the README of the plugin, JMH Gradle Plugin
has a benchmark under src / jmh
. It is assumed.
For this reason, it worked well by setting where the benchmark is, or by placing the benchmark under src / jmh
with the following configuration.
At this point, it should be noted that the benchmark body must be placed in a package that matches the groupId
of build.gradle
.
This is the build.gradle.kts
I was using.
kotlin:build.gradle.kts
plugins {
kotlin("jvm") version "1.4.10"
id("me.champeau.gradle.jmh") version "0.5.2"
}
group = "com.wrongwrong"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib"))
implementation(group = "org.openjdk.jmh", name = "jmh-core", version = "1.25.2")
}