我目前在使用jmeter maven插件运行测试的基于jmeter的项目上工作。到目前为止一切正常,直到我添加了perfmon的插件,将它们添加使用JMeter的UI获得每秒和响应时间交易一段时间后,按照说明here如何使用jmeter-maven-plugin使用perfmon插件?
现在行家运行它结果:
[INFO] Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'/Users/foo/Tools/src/platform-load-test/jersey2-load-test/target/jmeter/testFiles/JerseyAsync.jmx', missing class com.thoughtworks.xstream.converters.ConversionException:
[INFO] ---- Debugging information ----
[INFO] cause-exception : com.thoughtworks.xstream.converters.ConversionException
[INFO] cause-message :
[INFO] first-jmeter-class : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
[INFO] class : org.apache.jmeter.save.ScriptWrapper
[INFO] required-type : org.apache.jorphan.collections.ListedHashTree
[INFO] converter-type : org.apache.jmeter.save.ScriptWrapperConverter
[INFO] path : /jmeterTestPlan/hashTree/hashTree/hashTree/kg.apc.jmeter.perfmon.PerfMonCollector
[INFO] line number : 259
[INFO] version : 3.1 r1770033
[INFO] -------------------------------
继documentation添加额外的库(因为我已经添加了通过JMeter的用户界面的插件管理器中的perfmon的听众),我已经更新我的POM添加JMeter的扩展部分:
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.1.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>pre-integration-test</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<ignoreResultFailures>true</ignoreResultFailures>
<jmeterExtensions>
<jmeterExtension>kg.apc:jmeter-plugins-perfmon:2.1</jmeterExtension>
</jmeterExtensions>
</configuration>
</plugin>
和分析部分:
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-analysis-maven-plugin</artifactId>
<version>1.0.6</version>
<executions>
<execution>
<id>analyze-results</id>
<phase>post-integration-test</phase>
<goals>
<goal>analyze</goal>
</goals>
</execution>
</executions>
<configuration>
<source>${project.basedir}/target/jmeter/results/*.jtl</source>
<targetDirectory>${project.basedir}/target/reports</targetDirectory>
</configuration>
</plugin>
然而,这个结果:
[INFO] -------------------------------------------------------
[INFO] Configuring JMeter...
[INFO] -------------------------------------------------------
[WARNING] The POM for commons-math3:commons-math3:jar:3.4.1 is missing, no dependency information available
[WARNING] The POM for commons-pool2:commons-pool2:jar:2.3 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.196 s
[INFO] Finished at: 2017-02-16T16:13:31+08:00
[INFO] Final Memory: 20M/437M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:2.1.0:configure (configure) on project jersey2-load-test: Failure to find commons-math3:commons-math3:jar:3.4.1 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
其中指出,有invalid dependencies declared 在加入罐子扩展JMeter的正确路径假设IM,我怎么排除无效的依赖关系,并使用插件的jmeter扩展部分添加正确的依赖项?否则,如何在使用jmeter maven插件时正确添加perfmon插件依赖项?