I want to benchmark my application using JMH. I am using JMH with gradle as build tool. The github repository is here.
But whenever I run the application com.demo.aerospike.JMHAerospikeSpringData
I get below error.
$ gradle run
> Configure project :
Task :jmh Last added: null
> Task :run
JMHAerospikeSpringData is running ...
Exception in thread "main" java.lang.RuntimeException: ERROR: Unable to find the resource: /META-INF/BenchmarkList
at org.openjdk.jmh.runner.AbstractResourceReader.getReaders(AbstractResourceReader.java:98)
at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:122)
at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:256)
at org.openjdk.jmh.runner.Runner.run(Runner.java:206)
at com.demo.aerospike.JMHAerospikeSpringData.main(JMHAerospikeSpringData.java:47)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Process 'command
'/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I tried different solutions in other stackoverflow but couldn't help.
Any idea what I'm missing.
implementation 'org.openjdk.jmh:jmh-core:1.33'
annotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.33'
just like lombok
I have resolved this problem by adding this dependency to my project:
testAnnotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:$jmhVersion"
next to
testImplementation "org.openjdk.jmh:jmh-core:$jmhVersion"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With