melix / jmh-gradle-plugin

Integrates the JMH benchmarking framework with Gradle
Apache License 2.0
666 stars 88 forks source link

I cant get dependencies working for Sample Project #127

Closed elect86 closed 5 years ago

elect86 commented 6 years ago

Hi,

I tried to follow the wiki carefully, but all the @ are reds (unresolved)

This is my test project

Vincent-Carrier commented 6 years ago

Bump. Getting the same problem. Also using Kotlin. Tried different gradle and jmh plugin versions, manually adding source sets and dependencies, nothing to do.

pdorrestijn commented 6 years ago

I have the same issue's. I can run the gradle jmh goal, however it seems impossible to create a runnable jar. shadowJar and jar gradle configurations are completely ignored. Only by setting jmh includeTests, the dependencies are (partly) added to the shadow jar. jmh dependencies are not packaged in the runnable jar unless I explicitly add the jmh deps to also be the runtime deps. classpath is not set in runnable jar main class entry points to org.openjdk.jmh.Main (which is not present in the jar, and if it would the classpath is not set thus it still doesn't work).

Here is my build file: buildscript { repositories { jcenter() } dependencies { classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1' classpath 'me.champeau.gradle:jmh-gradle-plugin:0.4.5' } } plugins { // id 'java' id 'me.champeau.gradle.jmh' }

apply plugin: 'com.github.johnrengelman.shadow'

jmh { includeTests = true // else I get ClassNotFoundExceptions when exec gradle jmh?!? include = ['^.Benchmark\..$'] // Be ware: is also added to BenchmarkList exclude = ['^.remote.'] // Be ware: is exclusion is ignored in generated BenchmarkList resultFormat = 'JSON' jmhVersion = '1.19' verbosity = 'EXTRA' }

dependencies { /**

Is there a proper description on how to succesfully create a runnable jar?

elect86 commented 5 years ago

It seems now it works

I'll close it then