Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How to Create a Local Repository of JMeter Plugins

DZone's Guide to

How to Create a Local Repository of JMeter Plugins

Learn how to create your own local repository of JMeter plugins to add functionalities to load testing in this tutorial.

· Performance Zone ·
Free Resource

Container Monitoring and Management eBook: Read about the new realities of containerization.

Apache JMeter™ is a very powerful tool for load testing. One of the things that makes it so powerful, is its plugins. JMeter plugins enable constantly adding multiple functions and capabilities that aren't available in core JMeter, thus improving the tool. Because JMeter is such a popular tool with a large open-source community, many plugins are created for it.

The best place to find the most popular JMeter plugins is on the JMeter plugins website, which also provides a plugin manager for JMeter, or from this blog post. So, you can easily search for the plugin you want in the plugin manager and install it straight from the manager. This eliminates the need to manually download JAR files and place them in the lib/ext/ folder, as this is done automatically through the manager. Click here to learn to install the JMeter plugins manager.

So why would anyone need to create a local repository of JMeter plugins? Some organizations have very strict network restrictions. In these places, trying to install a JMeter plugin using the public plugin manager won't work, as the network will block any JAR file that is downloaded from outside of the organization's internal network.

Luckily, if you need to, it is pretty simple to create a local repository of JMeter plugins and configure the plugin manager to download the plugins JAR files from a local path. Let's learn how.

Step 1: Choose the Plugins

Create a list of all the JMeter Plugins you want to add. This is the list I created, you can use it as a reference:

Step 2: Download the plugins files

Download all the necessary JAR files, screenshot PNG files and helpUrl html files from jmeter-plugins.org and place them in a folder. This should be done on a computer outside the internal network.

Make sure you also download the plugins manager jar file. We will need it for later.

Move the files to your internal network. Now you have the local repository on your computer!

Step 3: Create a JSON File

Use the content from here. Each plugin starts with "{id".

For example:

{  
   "id":"bzm-random-csv",
   "name":"Random CSV Data Set",
   "description":"Config item that allows reading CSV files in random order",
   "screenshotUrl":"https://raw.githubusercontent.com/Blazemeter/jmeter-bzm-plugins/mas/random.png",
   "helpUrl":"https://github.com/Blazemeter/jmeter-bzm-plugins/blob/master/Random.md",
   "vendor":"BlazeMeter",
   "markerClass":"com.blazemeter.jmeter.RandomCSVDataSetConfig",
   "componentClasses":[  
      "com.blazemeter.jmeter.RandomCSVDataSetConfig",
      "com.blazemeter.jmeter.RandomCSVDataSetConfigGui"
   ],
   "versions":{  
      "0.1":{  
         "downloadUrl":"https://github.com/Blazemeter/jmeter-bzm-plugins/releases/csv-data-set-0.1.jar",
         "libs":{  
            "jmeter-plugins-cmn-jmeter":"https://search.maven.org/remotecontent?filepath=kg/apc/jmeter.jar"
         }
      }
   }
}


You don't need to create a JSON file for the plugins manager.

Step 4: Install a Web Server on Your Machine

I used Nginx:

  •  brew install nginx 
  • Place the plugins folder and the json file in /usr/local/Cellar/nginx/1.13.12/html/

  •  sudo apt-get update 
  •  sudo apt-get install nginx 
  • Place the plugins folder and the json file in /usr/share/nginx/html/

Step 5: Find Your Internal IP Address

Run the ifconfig   command ( ipconfig  for windows) to find your internal IP address.

Step 6: Add URLs

Replace all the URLs from the JSON file with URLs to your local Nginx web server on http://<your_internal_ip>:8080/ (in my example http://10.129.66.91:8080/)

Step 7: Install JMeter

Install JMeter from scratch, even if you had it on your computer before.

Step 8: Place the Plugins Manager JAR File in JMeter

Place the jmeter-plugins-manager JAR file in /lib/ext in your JMeter installation folder.

Step 9: Update Your JMeter Properties File

Add the following line to the jmeter.properties file:

jpgc.repo.address=http://10.129.66.91:8080/my_plugins.json

Step 10: Start JMeter and Install the Plugins!

The local JMeter plugins repository will be accessible to all computers in the same LAN in the internal network.

All you need to do it is follow steps 7-10, and you can run JMeter!

After creating your JMeter script, you can run it locally or upload it to BlazeMeter. By running your script in BlazeMeter you will be able to massively scale your tests, collaborate on tests and reports, and analyze results instantly or over time with insightful reports.

Take the Chaos Out of Container Monitoring. View the webcast on-demand!

Topics:
load testing ,performance testing ,jmeter ,performance ,tutorials

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}