Plugins Manager from Command-Line

If you want to use JMeter Plugins Manager in an automated fashion, you will need to make some preparations first:

  1. make sure cmdrunner-2.0.jar is present in jmeter/lib directory. If not, take it from here: http://search.maven.org/remotecontent?filepath=kg/apc/cmdrunner/2.0/cmdrunner-2.0.jar
  2. make sure PluginsManagerCMD.sh or PluginsManagerCMD.bat is present in jmeter/bin directory. If not, run java -cp jmeter/lib/ext/jmeter-plugins-manager-x.x.jar org.jmeterplugins.repository.PluginManagerCMDInstaller to have the files created

Now, you can use PluginsManagerCMD to get the status of plugins, install or uninstall them. The command-line is simple:

PluginsManagerCMD <command> [<params>]

Where command is one of "help", "status", "upgrades", "available", "install", "uninstall".

params is a string with plugin IDs, comma-separated, like this: jpgc-cmd,jpgc-json,jpgc-casutg. No spaces allowed currently. If you want to specify exact versions for plugins, do it like this: jpgc-json=2.2,jpgc-casutg=2.0

Example usages:

PluginsManagerCMD help
PluginsManagerCMD status
PluginsManagerCMD upgrades
PluginsManagerCMD available
PluginsManagerCMD install jpgc-fifo,jpgc-json=2.2
PluginsManagerCMD uninstall jmeter-tcp,jmeter-ftp,jmeter-jdbc

To use proxy with command line, please use JVM_ARGS environment variable to set proxy properties, like this:

JVM_ARGS="-Dhttps.proxyHost=myproxy.com -Dhttps.proxyPort=8080" PluginsManagerCMD status

If you need username/proxy for proxy, pass them like this:

JVM_ARGS="-Dhttps.proxyHost=myproxy.com -Dhttps.proxyPort=8080 -Dhttp.proxyUser=john -Dhttp.proxyPass=***" PluginsManagerCMD status

Using from BeanShell or JSR223

If you need to access the plugins versions information from scriptable components like BeanShell sampler, please use these two methods:

Single Plugin Info

Request for single plugin version, returns version string if plugin is installed, or null if plugin is not installed:
org.jmeterplugins.repository.PluginManager.getPluginStatus("jpgc-graphs-basic")

Example result of this function call is string like 1.3.0.

All Plugins Info

Returns a string containing plugin IDs with corresponding versions. Only the installed plugins are listed.

org.jmeterplugins.repository.PluginManager.getAllPluginsStatus()

Example result of this function call is string like [jpgc-graphs-basic=1.3.1, jpgc-sense=1.3.1, jpgc-cmd=1.3.1, jpgc-graphs-composite=1.3.1, jmeter-core=2.13, jmeter-components=2.13].