-
-
Notifications
You must be signed in to change notification settings - Fork 241
Specifying JMeter Version
In the 3.x.x version of the JMeter Maven Plugin you can specify the version of JMeter to use via config. There is of course a caveat with this method, it assumes that the list of libraries required has not changed (If the list of libraries that JMeter has used changes see below).
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>3.6.0</version>
<executions>
<!-- Generate JMeter configuration -->
<execution>
<id>configuration</id>
<goals>
<goal>configure</goal>
</goals>
</execution>
<!-- Run JMeter tests -->
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
<!-- Fail build on errors in test -->
<execution>
<id>jmeter-check-results</id>
<goals>
<goal>results</goal>
</goals>
</execution>
</executions>
<configuration>
<jmeterVersion>5.1.1</jmeterVersion>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>If you don't want to modify your POM you can also pass in a JMeter version on the command line like so:
mvn clean verify -Djmeter.version=5.0
Note JMeter 5.2 cannot be supported due to issues in its pom.xml files.
In the 2.x version of the JMeter Maven Plugin you can also specify the list of libraries that make up JMeter. This gives you the flexibility to specify old and new versions of JMeter where the list of dependent libraries has changed. You could even run your own customised build of JMeter in this way.
The caveat is that we perform some configuration that depends upon files that are in ApacheJMeter_config, if this changes it may break the plugin and will require a code change.
We will only ever support the current version of JMeter in code, if you want to try and use other versions we have given you the tools to try and get it working, but we don't expect to support it.
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>3.6.0</version>
<executions>
<!-- Generate JMeter configuration -->
<execution>
<id>configuration</id>
<goals>
<goal>configure</goal>
</goals>
</execution>
<!-- Run JMeter tests -->
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
<!-- Fail build on errors in test -->
<execution>
<id>jmeter-check-results</id>
<goals>
<goal>results</goal>
</goals>
</execution>
</executions>
<configuration>
<jmeterArtifacts>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter:5.1.1</jmeterArtifact>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter_components:5.1.1</jmeterArtifact>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter_config:5.1.1</jmeterArtifact>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter_core:5.1.1</jmeterArtifact>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter_ftp:5.1.1</jmeterArtifact>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter_functions:5.1.1</jmeterArtifact>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter_http:5.1.1</jmeterArtifact>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter_java:5.1.1</jmeterArtifact>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter_jdbc:5.1.1</jmeterArtifact>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter_jms:5.1.1</jmeterArtifact>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter_junit:5.1.1</jmeterArtifact>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter_ldap:5.1.1</jmeterArtifact>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter_mail:5.1.1</jmeterArtifact>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter_mongodb:5.1.1</jmeterArtifact>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter_native:5.1.1</jmeterArtifact>
<jmeterArtifact>org.apache.jmeter:ApacheJMeter_tcp:5.1.1</jmeterArtifact>
</jmeterArtifacts>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>Note that for example, if you need to modify the file used by JMeter HTML report, you can bundle the files in a jar following same layout as ApacheJMeter_config, and reference it instead of core ApacheJMeter_config.