melix / jmh-gradle-plugin

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

Unable to exclude dependency on jopt-simple #126

Open sbrannen opened 6 years ago

sbrannen commented 6 years ago

Using version 0.4.5 of the me.champeau.gradle.jmh plugin in JUnit 5's platform-tests module, I cannot figure out how to exclude the transitive dependency on jopt-simple.

The reason I want to exclude it is that the module already pulls in a newer version of jopt-simple.

So, even though I have the following exclude in the dependencies configuration:

jmh("org.openjdk.jmh:jmh-core:${jmhVersion}") {
    exclude group: 'net.sf.jopt-simple', module: 'jopt-simple'
}

The Eclipse.classpath for platform-tests ends up with versions 4.6 (from jmh-core) and 5.0.4 (from junit-platform-console) in it.

Is this an issue with the jmh-gradle-plugin?

Or... is this an issue with Gradle in general?

Or... am I somehow configuring the exclude wrong?

I assume it is not the latter, since the exclude for mockito-junit-jupiter appears to work fine in the same file.

Please enlighten me! 😉