3

My question is similar to How to use JMH with gradle?, only with one caveat that I use Gradle Kotlin DSL. I also found this article https://arbitrary-but-fixed.net/java/algorithms/2019/09/29/jmh-gradle-config.html, but it unfortunately does not work when I have multiple subprojects. I have to define the tasks dependencies for each subproject for the @Benchmark annotation to be recognized. Just by simply adding the JMH-related dependencies with the allprojects{} closure at root project will strangely result in unresolved reference: implementation for the subprojects.

Let's say that I have one root project with 2 subprojects, each of them just benchmarking Hello World. Can anyone help me defining the build.gradle.kts and possibly the settings.gradle.kts for all projects?

I use OpenJDK 17 with Gradle 7.4.2

Phuc Mai
  • 41
  • 3

0 Answers0