About CLASSPATH #115
Replies: 1 comment
-
Hi, so it really depends how you execute your scripts but let's go through different scenarios:
Saying that we might agree that there should be some possibility to run groovy-jmeter without specifying classpath, but then we would need some default folder where the groovy-jmeter will look at for the plugin .jar files. Same as the JMeter GUI is doing right now. As an alternative you can try to add required dependencies with @grab annotation, e.g. something like: @Grab('kg.apc:jmeter-plugins-dummy:0.4')
@GrabExclude('xml-apis:xml-apis')
@GrabExclude('xercesi:xercesImpl') The script from examples/plugins/include would look like this: @GrabConfig(systemClassLoader=true)
@Grab('net.simonix.scripts:groovy-jmeter')
@Grab('kg.apc:jmeter-plugins-dummy:0.4')
@GrabExclude('xml-apis:xml-apis')
@GrabExclude('xercesi:xercesImpl')
@groovy.transform.BaseScript net.simonix.dsl.jmeter.TestScript script
start {
plan {
group(users: 10, rampUp: 1) {
include 'dummy_plugin.jmx'
}
summary(file: 'script.jtl', enabled: true)
}
} But, first the plugin needs to be in public maven repository or you need your own local repository with installed plugins or your company can provide you some kind artifactory where groovy can look for the plugins. The second you need to deal with some dependencies problems since plugin can use older version of some libraries which is not compatible with Jmeter dependencies. Here I must add those GrabExclude so they don't break the script. |
Beta Was this translation helpful? Give feedback.
-
Originally posted by @smicyk in #112 (comment)
This is a follow up question on above, and more about groovy-jmeter's internal behaviour -- how it constructs jmeter script and how it calls jmeter internally.
Suppose that I've manually created from groovy-jmeter's groovy as jmeter script, and I invoke my jmeter on such jmeter script, then for any plugin that jmeter uses, I don't need to specify them on jmeter's command line, right?
Now, when it comes to
groovy my-groovy-jmeter-script.groovy
, i.e., constructing jmeter script and calling jmeter all internally by groovy-jmeter, I'd assume that, for any plugin that jmeter uses, I don't need to specify them on jmeter's command line either, even for the another InfluxDb BackendListener, right?Beta Was this translation helpful? Give feedback.
All reactions