JMeter plugins when running with Maven

Can I use JMeter Plugins when running JMeter from jmeter-maven-plugin ?

UPDATE

I tried to add the jmeter-plugins dependency to the plugin definition according to the Ardesco useful answer, but I get a lot of ClassNotFoundException s. Maven doesn't seem to put jmeter-plugin transit dependencies on the class path when running JMeter. Any ideas?

+7
maven jmeter jmeter-plugins jmeter-maven-plugin
source share
2 answers

Although this answer is accepted, it only works for versions prior to 2.X. But for version above 2.X, see Answer.

Yup, you can add any libraries that you need by adding dependencies to the plugin, any explicitly defined dependencies will be copied to your jmeter / lib directory.

If the dependency is a JMeter plugin, you can specify this in your configuration, and then this dependency will be copied to your meter / lib / ext directory:

 <plugin> <groupId>com.lazerycode.jmeter</groupId> <artifactId>jmeter-maven-plugin</artifactId> <version>1.9.0</version> <executions> <execution> <id>jmeter-tests</id> <phase>verify</phase> <goals> <goal>jmeter</goal> </goals> <configuration> <jmeterPlugins> <plugin> <groupId>kg.apc</groupId> <artifactId>jmeter-plugins</artifactId> </plugin> </jmeterPlugins> </configuration> </execution> </executions> <dependencies> <dependency> <groupId>kg.apc</groupId> <artifactId>jmeter-plugins</artifactId> <version>1.1.3</version> </dependency> </dependencies> </plugin> 

This feature was broken before version 1.9.0.

+9
source share

Use version 2.6.0 or the top of the plugin

and add:

 <configuration> <jmeterExtensions> <artifacts>kg.apc:jmeter-plugins-casutg:2.4</artifacts> </jmeterExtensions> <excludedArtifacts> <exclusion>commons-pool2:commons-pool2</exclusion> <exclusion>commons-math3:commons-math3</exclusion> </excludedArtifacts> ... </configuration> 
0
source share

All Articles