Last active
September 7, 2016 20:29
-
-
Save djangofan/d74c3ea8450d7c55f054 to your computer and use it in GitHub Desktop.
A build.gradle to load Jmeter with all the Jmeter-plugins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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