Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sergeyradov/0f71770e989506c3538ed56fc8e0f028 to your computer and use it in GitHub Desktop.
Save sergeyradov/0f71770e989506c3538ed56fc8e0f028 to your computer and use it in GitHub Desktop.
A build.gradle to load Jmeter with all the Jmeter-plugins
// https://github.com/kulya/jmeter-gradle-plugin
// run with 'gradle addToJmeterClasspath jmeterEditor'
apply plugin: 'jmeter'
apply plugin: 'java'
List<String> pluginList = new ArrayList<String>()
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "com.github.kulya:jmeter-gradle-plugin:1.3.3-2.13"
classpath "org.codehaus.groovy:groovy-all:2.4.0"
classpath "com.opencsv:opencsv:3.1"
classpath "com.google.guava:guava:18.0"
classpath "org.apache.commons:commons-lang3:3.4"
classpath "kg.apc:jmeter-plugins-standard:1.2.1"
classpath "kg.apc:jmeter-plugins-common:1.2.1"
classpath "kg.apc:jmeter-plugins-extras:1.2.1"
classpath "kg.apc:jmeter-plugins-extras-libs:1.2.1"
classpath "kg.apc:jmeter-plugins-webdriver:1.2.1"
}
configurations.classpath.exclude group: 'commons-math3', module: 'commons-math3'
configurations.classpath.exclude group: 'commons-pool2', module: 'commons-pool2'
}
task addToJmeterClasspath << {
println "\nLoading the following jmeter plugins..."
buildscript.configurations.classpath.each {
String absolutePath = it.getAbsolutePath();
if (absolutePath.contains("jmeter-plugins") || absolutePath.contains("groovy") || absolutePath.contains("guava") || absolutePath.contains("opencsv") || absolutePath.contains("commons-lang3") ) {
println " " + absolutePath;
pluginList.add(absolutePath.replace("\\","/"));
}
}
println ""
}
jmeterRun.configure {
enableReports = true
jmeterIgnoreFailure = false
jmeterIgnoreError = false
}
jmeterEditor.configure {
maxHeapSize = "1200M"
jmeterPluginJars = pluginList
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment