-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scala: Unable to find the resource: /META-INF/BenchmarkList #13
Comments
Hi! Do you have |
Seems like you have an inner module |
I'm having a similar issue wanting to run jmh in a subproject. @artyushov could you explain the proposed workaround? I tried adding the jmh plugin and dependencies to the root project instead and run the |
I got
After upgrade of IntelliJ plugin from 1.0.1 to 1.0.2 Gradle Plugin:
JMH Version:
|
@pranasblk Are you sure you have |
Yes, the explicit entry to the classpath of jmh scope was missing (dynamically resolved in gradle run-time and IntelliJ previously). Thanks for the note! |
@pranasblk What specifically did you need to do in order to add jmh-generator-annprocess to the classpath of jmh scope? I tried adding |
@jaredjstewart I use local/proxied corresponding artefacts. JMH related fragments I use:
|
I am seeing this problem, and I can't find a workaround. Here is my build.gradle:
Here's the output when I run, forcing tasks to run:
I see the raw file at:
Here's an elided listing of the jar contents:
What can I do to resolve this? |
It seems like sometimes I can get this to work, but I'm not sure what I have been doing that is making it work. Just a minute ago, I ran I also notice that when I searched for BenchmarkList again, I found it in additional places:
I then re-ran the same command and it worked again. |
Adding dependency "org.openjdk.jmh:jmh-generator-annprocess" solved an issue for me. |
Ran into the same problem. If you are on Gradle, like me, then https://github.com/melix/jmh-gradle-plugin does really simplify it! |
Just tried to replicate this example: https://www.mkyong.com/java/java-jmh-benchmark-tutorial I am not using Maven but Eclipse:
|
The solution for me was to use
instead of
Mind that my setup is a bit non-standard - I run JMH from JUnit. Still, this solved missing BenchmarkList problem. Also I don't use jmh-gradle-plugin, only those two dependencies from above are enough to integrate JMH to JUnit. |
@metamaker: Switching from |
This works for me , I am also using JMH + JUnit |
I am using IntelliJ IDEA Ultimate with a plain old Java Module (no Maven or Gradle). I downloaded the JHM suite as a dependency, I made sure that all of the above suggestions are done on my side. Most importantly:
Tried building, compiling, cleaning, running, changing the configuration, running again with no luck. Then I added the fully qualified name of the annotation processor that has to run, and it worked: You do this under: Build, Execution, Deployment > Compiler > Annotation Processors (see screenshot). I wonder if you want to add some business logic to the module to not just offer to enable AP, but also add the FQN? |
Following instructions here: artyushov/idea-jmh-plugin#13 (comment)
Following instructions here: artyushov/idea-jmh-plugin#13 (comment)
Seconding this, changing to |
If you're using the jmh-gradle-plugin you just need to have all of the following in your dependencies block: jmh 'org.openjdk.jmh:jmh-core:1.34'
jmh 'org.openjdk.jmh:jmh-generator-annprocess:1.34'
// this is the line that solved it for me
jmhAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.34' Then I was able to run the test from within the IDE (I'm using IntelliJ). |
I added this to my build.gradle and solved the problem, I can run from IntelliJ
|
@caseyscarborough Thanks, you're a life-saver! |
Had to add this and that build plugin to <dependencies>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>${jmh.version}</version>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>${jmh.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>benchmarks</finalName>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.openjdk.jmh.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build> |
This worked for me... |
@WebTiger89 Using Now you can press the "play" button in Intellij to run the JMH benchmarks. I wasn't able to make it work using |
Adding below line in my build.gradle solves it for me.
|
idea ultimate 14.1.2 + scala plugin 1.4.15 + jmh plugin 1.0.1
I have an sbt project opened in IDEA. When I run one benchmark method or all methods in a class I get this error:
The text was updated successfully, but these errors were encountered: