Maven JMeter plugin and report generation (the last steps to get it working)


JMeter ( a powerful tool for functional and performance testing web applications. JMeter, opposed to selenium, also works perfectly on generated applications (like Oracle ADF ). One of the key strengths of JMeter is the automation. The same test can be repeated after each (minor) release. This is a great help in executing time consuming regression testing.

We use Maven 2 ( in combination with Continuum ( as the basis of our AMIS-SoftwareStudio. With the build schema in Continuum we are able to execute both performance and functional regression testing every night (or even each hour if you like) on the most recent version of the application from our source repository.

The documentation on the JMeter wiki ( is to limited to get the JMeter plugin working at once. It does not handle the generation of reports and installing the plugin into your company repository. Most of the samples on the internet (use the Google to find Maven 2+JMeter) are based on extensive Ant scripts. The sample below shows how to get the Maven-JMeter-Plugin working in Maven2 with a minimum of extra code in your projects pom.xml.

Assume you have:

  • Java 1.5 and Maven 2.0.7 already installed
  • An internal central Maven2 repository in your network
  • And your maven settings.xml a reference to your local company repository (see below)

Add to settings.xml

    <!--   Internal repository for deployment of AMIS artifacts -->
      <!--   Put the name of your company repository here-->

Install the Maven-JMeter-Plugin:

Install the plugin:
1.    Download the Maven-Jmeter-Plugin form the apache wiki (there is no official distribution yet)  Link here.
2.    Untar these files with e.g. WinRar or WinZip.
3.    Edit the pom.xml:

a.    Remove the reference to the yahoo music repository
b.    Add a compile plugin to force usage of jdk1.5 (to avoid compile errors)
The pom.xml should look like this (Link download):

4.    Go to the maven-jmeter-plugin folder and deploy the plugin in your local company repository:   mvn deploy (you can check first  if it works by using mvn install)

5.    The Maven JMeter plugin is now installed and available in your internal repository.

 Getting your project working with the JMeter plugin:

 This section is an extension on the information from the JMeter Wiki.

  1. Create a src/test/jmeter directory, and place your JMeter load tests there.
  2. Create a file in src/test/jmeter. Just copy the default properties file from the JMeter install.
  3. Edit the  and change the to XML ( to force JMeter to produce XML files in stead of CSV files.
  4. Optionally configure includes and excludes in your pom.xml for which tests to run. If you don’t, it will just run **/*.jmx.
  5. Add a reference to in your pom. This is some place where maven can download jmeter-2.2.jar. (other locations are also valid (use the Google)).  
  6. Add the Maven JMeter plugin and link it to the Verify phase of your project. This way it is automatically executed after deployment of the application on the target platform.
  7. Run the mvn verify command to start the JMeter tests.

Creating the JMeter results report:

This section explains how to generate a JMeter Report after executing the tests.

  1. Create a test_resources\jmeter\jakarta-jmeter-2.2\extras folder and add the following files form the JMeter Extras install: collapse.jpg; expand.jpg; jmeter-results-detail-report_21.xsl ; jmeter-results-report_21.xsl
  2. Add the xml-maven-plugin to force transition of the jmeter results.xml to HTML.
  3. Use the Filemapper option to rename the files to HTML
                 <fileMapper implementation="">


4.    Finally use antrun to copy the expand and collaps images to the generated target files. (see sample below)

5.    In continuum you can use the command mvn verify site-deploy to run the jmeter tests and deploy the results within the project site.

<!-- make sure the jmeter icons are copied to the site folder -->
                     <copy file="test_resources\jmeter\jakarta-jmeter-2.2\extras\expand.jpg"
                     <copy file="test_resources\jmeter\jakarta-jmeter-2.2\extras\collapse.jpg"


About Author

Robbrecht van Amerongen is Business Innovation Manager at AMIS Services. He has a vast experience in managing software development and delivery projects and growing the development unit of AMIS. He is able to utilize new technologies and methodologies to valuable products and services for his customers. His expertise lies in all aspects of software engineering; ranging from continuous delivery, provisioning, cloud computing, user experience and wearables. Robbrecht is also an Agile coach and Certified Agile Master. He has experience in managing Agile projects with Scrum (first with DSDM) ranging back to 1999. Robbrecht is a strong proponent of the agile principles. Robbrecht is agile examiner for the agile foundation, practitioner and master certificate.


  1. A lot of the problems mentioned in the comments have been fixed in the latest version and this plugin is now under active development again.  It is now available from the central maven repository so you no longer need to specify a repository in your POM to use it, all that is required now is:
    Note that the GroupID and ArtifactID have changed.
    Project website is

  2. We are having a problem with functions like ${__threadNum}, they are not being replaced when JMeter is executed by the Maven plugin. Has anybody experienced the same? Any ideas what might be causing this? No problems when running the script with the JMeter GUI or command-line. I did find the following messages in the logging:

    2007/10/03 15:55:49 DEBUG – Not running version, return raw function string
    2007/10/03 15:55:49 DEBUG – jmeter.engine.util.ValueReplacer: Replacement result: test${__threadNum}

  3. Well, I finally found out the way to do this. Is not nice but it works.

    I had to modify the Maven JMeter Plugin to add all the needed classes to the ClassLoader that JMeter uses.
    This is achieved reading a text file with all the dependencies of the project (generated previously with the maven-dependency-plugin).

    I’m waiting that Tim McCune confirm me that he accepts my modification to update his plugin.

  4. Robbrecht van Amerongen on

    I have no experience with JunitSampler option within Jmeter. This features is introduced in version 2.1.2.
    I think you have to add the test.jar as an dependency within your pom. I have not tried this yet.
    The HTTPSampler does not give these problems.

  5. Hi Bobbrecht, I have deployed jmeter-2.2.jar in a internal repository. The log says that it couldn’t find my test classes.
    What do you mean with JMeter helper classes?
    I have all the dependencies that JMeter needs

    I have this line in my target/jmeter/jmeter.log file:

    2007/08/13 11:06:38 WARN – ClassNotFoundException::

    Can you tell me which version of Java are you using?
    Maybe there is a problem with classpath.


  6. Robbrecht van Amerongen on

    The whole Jmeter process is run in maven. It seems that the ClassNotFoundException has to do with something in your JMeter Test.
    You should add additional helper class files from JMeter as an dependency in your pom.xml.

    I hope this will solve your problem.

  7. Haven’t you got a ClassNotFoundException in the jmeter/jmeter.log file after running it?
    If you did, how did you solve it?