I am using lazerycode jmeter maven plugin to execute my jmeter tests.
When I try to run my jmx file from the UI, it runs perfectly fine.
but, when I try with to do with mvn,
mvn clean install or mvn verify
It starts executing but it fails at a point where I have used the JSON extractor to extract some values from response. Below is the error I get,
[INFO] Uncaught Exception java.lang.NoClassDefFoundError: com/jayway/jsonpath/internal/JsonReader. See log file for details.
This is the POM that I am using:
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.6.0</version>
<configuration>
<testResultsTimestamp>false</testResultsTimestamp>
<propertiesUser>
<!-- Some user properties here -->
</propertiesUser>
<jmeterExtensions>
<artifact>kg.apc:jmeter-plugins-manager:0.19</artifact>
<artifact>Kg.apc:jmeter-plugins-extras-libs:1.3.1</artifact>
<artifact>kg.apc:jmeter-plugins-json:jar:2.3</artifact>
</jmeterExtensions>
<!-- The plugin uses some broken dependencies
An alternative is to set this to true and use excludedArtifacts, see below
-->
<downloadExtensionDependencies>false</downloadExtensionDependencies>
</configuration>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins-extras-libs</artifactId>
<version>1.3.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Below is the complete logs from the jmeter log file:
2018-02-11 18:44:20,835 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1 2018-02-11 18:44:20,857 ERROR o.a.j.JMeter: Uncaught exception: java.lang.NoClassDefFoundError: com/jayway/jsonpath/internal/JsonReader at com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor.process(JSONPathExtractor.java:102) ~[jmeter-plugins-extras-libs-1.3.1.jar:?] at org.apache.jmeter.threads.JMeterThread.runPostProcessors(JMeterThread.java:833) ~[ApacheJMeter_core-3.3.jar:3.3 r1808647] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:524) ~[ApacheJMeter_core-3.3.jar:3.3 r1808647] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:424) ~[ApacheJMeter_core-3.3.jar:3.3 r1808647] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255) ~[ApacheJMeter_core-3.3.jar:3.3 r1808647] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151] Caused by: java.lang.ClassNotFoundException: com.jayway.jsonpath.internal.JsonReader at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_151] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_151] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_151] ... 6 more
I have added multiple libraries in the pom.xml as described here but the problem is not resolved.