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

1

6

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.

Metallize answered 3/8, 2016 at 22:26 Comment(0)
M
1

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
Metaphor answered 12/9, 2016 at 19:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.