No benchmarks found w/ version >= 0.5

Andrew Bissell abissell at gmail.com
Sun Mar 9 00:52:38 UTC 2014


I am using a gradle build script with the shadow plugin to generate a
microbenchmarks.jar file from some JMH annotated microbenchmark classes.
If I run the script using JMH version 0.4.2 or earlier, the benchmarks make
it into the jar and are able to run as expected.  But starting with version
0.5, the shadowJar task completes successfully, but I am not seeing any
benchmarks appear at all (as confirmed by running `java -jar
microbenchmarks.jar -l`).  Just wondering if something has changed with the
regexes or maybe I need to tweak my build process somehow.

A quick scan of the debug logging from the shadowJar process didn't show
any obvious differences or problems in how it is being run with the later
version.  I should also point out, I'm using JDK build 1.8.0-b132.  I've
also included my gradle build script below.

Thanks!
AB

================ build.gradle ===========================

apply plugin: 'java'
apply plugin: 'shadow'
apply plugin: 'idea'

sourceCompatibility = 1.8

sourceSets {
    main {
        resources {
            srcDir 'conf'
        }
    }
}

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies() {
        classpath 'com.github.jengelman.gradle.plugins:shadow:0.8'
    }
}

jar {
    manifest {
        attributes 'Main-Class': 'org.openjdk.jmh.Main'
    }
}

repositories {
    mavenLocal()
    mavenCentral()
}

shadow {
    exclude 'META-INF/*.DSA'
    exclude 'META-INF/*.RSA'
    outputFile = new File("build/libs/microbenchmarks.jar")
}

dependencies {
    compile group: 'org.openjdk.jmh', name: 'jmh-core', version:
'0.4.2'
    compile fileTree(dir: 'libs', include: '*.jar')
}

test.scanForTestClasses = false


More information about the jmh-dev mailing list