melix / jmh-gradle-plugin

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

Gradle 5.0 warning #123

Closed sormuras closed 6 years ago

sormuras commented 6 years ago

After upgrading to Gradle 4.6-rc-1, we see the following warning in the build log:

:platform-tests:compileJmhJava Putting annotation processors on the compile classpath has been deprecated and is scheduled to be removed in Gradle 5.0. Please add them to the processor path instead. If these processors were unintentionally leaked on the compile classpath, use the -proc:none compiler option to ignore them.

Using in platform-tests.gradle

plugins {
    id "me.champeau.gradle.jmh" version "0.4.5"
}

Happens in this feature branch: https://github.com/junit-team/junit5/compare/gradle-4.6

sormuras commented 6 years ago

Still happening with Gradle 4.7 - https://travis-ci.org/junit-team/junit5/jobs/368807534#L1917

tbroyer commented 6 years ago

@sormuras Remove jmh-generator-annprocess from the dependencies, or add it to jmhAnnotationProcessor instead (but then you'll still run into #125, that you worked around using a warn duplicate classes strategy)

sormuras commented 6 years ago

Thanks for the hint, @tbroyer

I changed the source set from jmh to jmhAnnotationProcessor. That resolved the annotation processors on the compile classpath warning and it didn't led to duplicate classes. Can run gradlew jmh like a charm.

For the record. Before:

jmh("org.openjdk.jmh:jmh-generator-annprocess:${jmhVersion}")
jmh(project(':junit-jupiter-api'))
jmh("junit:junit:${junit4Version}")

After:

jmhAnnotationProcessor("org.openjdk.jmh:jmh-generator-annprocess:${jmhVersion}")
jmh(project(':junit-jupiter-api'))
jmh("junit:junit:${junit4Version}")