我通过mvn运行jmeter testscript时遇到错误。
这是我的pom.xml
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.2.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<jmeterExtensions>
<artifact>kg.apc:jmeter-plugins:pom:1.3.1</artifact>
</jmeterExtensions>
<jmeterExtensions>
<artifact>kg.apc:jmeter-plugins-manager:jar:0.10</artifact>
</jmeterExtensions>
<jmeterExtensions>
<artifact>kg.apc:jmeter-plugins-json:jar:2.3</artifact>
</jmeterExtensions>
<junitLibraries>
<artifact>com.lazerycode.junit:junit-test:1.0.0</artifact>
</junitLibraries>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
</dependencies>
Jmeter日志文件:
2017/08/17 16:57:42错误 - jmeter.save.SaveService:转换错误com.thoughtworks.xstream.converters.ConversionException:com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor:com.atlantbh .jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor:com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor:com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor ----调试信息---- 消息:com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor:com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor cause-exception:com.thoughtworks.xstream.mapper.CannotResolveClassException cause-message:com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor:com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor class:org.apache.jorphan.collections.ListedHashTree required-type:org.apache.jorphan.collections.ListedHashTree 路径:/jmeterTestPlan/hashTree/hashTree/hashTree[2]/hashTree/hashTree/com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor 行号:76
我尝试了所有事情,但仍然没有成功。
以下是我正在获取的错误的控制台输出
[错误]无法执行目标com.lazerycode.jmeter:jmeter-maven-plugin:2.2.0:在项目jmeter-demo上配置(configure):找不到工件commons-math3:commons-math3:jar: 3.4.1在中央(https://repo.maven.apache.org/maven2) - &gt; [帮助1]
答案 0 :(得分:2)
您需要将以下行添加到pom.xml文件的- roles:
# without or with default parameters
- jenkins_configure_proxy
# with custom parameters
- role: jenkins_configure_proxy
jenkins_home: "{{ jenkins_home }}"
proxy_host: "{{ proxy_host }}"
部分:
jmeterExtensions
您遇到的错误是关于JSON Path Extractor Maven工件中遗失的jmeter-plugins-json
更多信息: