0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【JMH】JMH Gradle PluginでFAILURE: Build failed with an exception. A failure occurred while executing me.champeau.gradle.IsolatedRunnerと言われた場合の対処【Gradle】

Posted at

JMH Gradle Pluginme.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

自分の場合、ベンチマーク関連のディレクトリ構成が原因でした。

プラグインのREADMEに記載されている通り、JMH Gradle Pluginではsrc/jmh配下にベンチマークが有ることを想定しています。
このため、どこにベンチマークが有るかを設定するか、以下のような構成でsrc/jmh配下にベンチマークを配置することで上手くいきました。
image.png

ここで、ベンチマーク本体はbuild.gradlegroupIdに合わせたパッケージに配置する必要が有る点にも注意が必要です。

おまけ

利用していたbuild.gradle.ktsです。

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")
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?