jmh-gradle-plugin icon indicating copy to clipboard operation
jmh-gradle-plugin copied to clipboard

gradle jmh error

Open jonyangx opened this issue 3 years ago • 1 comments

Describe the bug

  • What went wrong: Execution failed for task ':jmhRunBytecodeGenerator'.

Could not resolve all files for configuration ':jmh'. Cannot resolve external dependency org.openjdk.jmh:jmh-core:1.29 because no repositories are defined. Required by: project : Cannot resolve external dependency org.openjdk.jmh:jmh-generator-bytecode:1.29 because no repositories are defined. Required by: project :

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!

jonyangx avatar Jan 10 '22 09:01 jonyangx

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

repositories {
    mavenCentral()
}

KarboniteKream avatar Jan 29 '22 03:01 KarboniteKream