kulya / jmeter-gradle-plugin

Other
40 stars 27 forks source link

Can you add sample documentation for adding a 3rd party jars to Jmeter? #35

Closed djangofan closed 9 years ago

djangofan commented 9 years ago

Can you add sample documentation for adding a 3rd party jars to Jmeter?

I am experimenting with your "gradle jmeter" plugin here: https://github.com/djangofan/run-jmeter-with-plugins-via-build-tools

In the above link, I am able to add groovy-all.jar (v.2.4.0) , opencsv.jar (v3.1), etc., as well as control the specific versions of the 3rd party plugins used by Jmeter, when I use Maven runner to load the dependencies.

I am trying to do the same with your Gradle plugin but I am unable to figure out how to get Jmeter to pick up the dependencies specified in the build.gradle, and even more importantly, I am unable to override the default version of groovy that you include "under the hood" by specifying a newer version of groovy in the Gradle dependencies.

None of this is an issue when using the Maven Jmeter plugin. Can you help?

foragerr commented 9 years ago

You can add 3rd party jars to jmeter with the user.classpath property. Semi-colon separated jar files in windows, colon separated in linux.

Probably the simplest way to add the user.classpath property to this plugin is to create a user.properties file containing user.classpath and add the following to your gradle build script:

jmeterRun.configure{
    jmeterPropertyFile = file("/pathTo/user.properties")
}

Note: The third folder option only works in the newer versions of jmeter. I know for certain, it works in 2.13 and does not work in 2.9, I haven't really tried the ones in between. If you want to use this plugin with jmeter 2.13, checkout my fork of this project.

djangofan commented 9 years ago

Thanks for the fork. :-) In your fork, do you have a way to update the Jmeter plugin packs to version 1.2.1 ?

foragerr commented 9 years ago

Sorry, I am not familiar with the plugin packs. If you just downloaded jmeter binaries, what do you need to change to support plugin pack 1.2.1?

djangofan commented 9 years ago

The plugins are just simple Maven dependencies: http://search.maven.org/#search|ga|1|jmeter-plugins . I just couldn't figure out where to specify those dependencies in the Kulya launcher. After you add the dependencies for 1.2.1, you should see the "RemoteWebDriver" sampler , among many others show up in the Sampler menu.

foragerr commented 9 years ago

https://github.com/kulya/jmeter-gradle-plugin/blob/master/src/main/groovy/com/github/kulya/gradle/plugins/jmeter/JmeterAbstractTask.groovy#L118

This line says you should be able to define jmeterPluginJars property in the build.gradle file. Not entirely sure what value this property takes.

Edit: looks like list of jar-filenames : List<String> jmeterPluginJars;

foragerr commented 9 years ago

@djangofan Can you close this issue please?

djangofan commented 9 years ago

Ok, I will fork the project , make the doc change myself, and submit a pull request instead.