melix / jmh-gradle-plugin

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

gradle jmh error #217

Open jonyangx opened 2 years ago

jonyangx commented 2 years ago

Describe the bug

build.gradle classpath "me.champeau.jmh:jmh-gradle-plugin:0.6.6"

ependencies {

    api group: 'org.openjdk.jmh', name: 'jmh-generator-annprocess', version: '1.34'
    api group: 'org.openjdk.jmh', name: 'jmh-core', version: '1.34'

}

apply plugin: "me.champeau.jmh"

jmh {
    includes = ['.*Benchmark']
    warmupIterations.set(2)
    iterations.set(2)
    fork.set(2)
    includeTests = true
}

To Reproduce Steps to reproduce the behavior:

  1. gradle clean jmh
  2. See error

Bugs reported with a simple, minimal example are more likely to be fixed quickly than bugs without reproducers: figuring out a way to reproduce your problem is often what takes most time, so anything you can do to provide the minimal reproducible example, ideally in form of a test case, is welcome!

KarboniteKream commented 2 years ago

As the error says, you have not defined any repositories. You can add the following to your build.gradle

repositories {
    mavenCentral()
}