Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to append /META-INF/BenchmarkList to jmh task to fix "ERROR: Unable to find the resource: /META-INF/BenchmarkList"

I'm new to micro bench-marking in general. When I execute the JMH task in my project I get "ERROR: Unable to find the resource: /META-INF/BenchmarkList", I believe is created by jmh-generator-annprocess. I am using Gradle and I am trying to figure out if jmh-generator-annprocess is even working? Will it work properly for Gradle or do I need to use the Maven plugin or something?

https://github.com/coderrick/JMH-Studies.git in case you want to git clone my project and run it yourself.

like image 717
coderrick Avatar asked Nov 09 '22 11:11

coderrick


1 Answers

There was a couple of issues

  1. JMHSample_02_BenchmarkModes class was in incorrectly named java class
  2. build.gradle was missing apply plugin: "me.champeau.gradle.jmh" declaration
  3. In jmhJar section Main-Class manifest entry was overridden (which is unnecessary)

I've made a PR with above fixes. After applying it you can run performance tests using

java -jar build/libs/JMH-Studies-jmh.jar
like image 67
vsminkov Avatar answered Nov 14 '22 23:11

vsminkov