【发布时间】:2017-09-26 12:24:55
【问题描述】:
我正在使用 Apache JMeter 通过 com.lazerycode.jmeter:jmeter-maven-plugin 对我的 Web 应用程序进行性能测试。 由于 3.2 版本带来了很多变化,我想知道是否可以在 jmeter-maven-plugin 中使用这个版本(这不是 Apache JMeter 项目的一部分)。
我尝试了以下方法:
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.1.0</version>
<configuration>
<jmeterVersion>3.2</jmeterVersion>
<jMeterProcessJVMSettings>
<xms>1024</xms>
<xmx>1024</xmx>
<arguments>
<argument>-Xprof</argument>
<argument>-Xfuture</argument>
</arguments>
</jMeterProcessJVMSettings>
</configuration>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>test</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
jmeter-maven-plugin 中 jmeter 的标准版本是 3.1。 我发现这是指定库: https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Specifying-JMeter-Version
上面的配置对我不起作用。我得到一个 NPE(空指针异常)。
[INFO] >>> jmeter-maven-plugin:2.1.0:jmeter (jmeter-tests) > :configure @ EAdresseBatchImportCapacityTests >>>
[INFO]
[INFO] --- jmeter-maven-plugin:2.1.0:configure (configure) @ EAdresseBatchImportCapacityTests ---
[INFO] -------------------------------------------------------
[INFO] Configuring JMeter...
[INFO] -------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.136 s
[INFO] Finished at: 2017-04-28T13:28:40+02:00
[INFO] Final Memory: 20M/217M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:2.1.0:configure (configure) on project EAdresseBatchImportCapacityTests: Failure to find org.apache.jmeter:ApacheJMeter_monitors:jar:3.2 in http://maven-repository.11.am-gruppe.de:8090/nexus/content/groups/gdis was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]
如果我使用上面链接中描述的旧库 (ApacheJMeter_monitors:jar:3.1),它不起作用 (NPE),新库不存在,因为从项目依赖项中删除了监视器包。 (你可以在这里看到:https://jmeter.apache.org/usermanual/build-monitor-test-plan.html)
我需要等待新版本的 jmeter-maven-plugin 吗?
也许你们中的某个人可以帮助我弄清楚如何让它发挥作用。 提前致谢。
【问题讨论】:
-
2017 年 5 月 7 日发布了新版本的 jmeter-maven-plugin。只需使用它就可以了。 artifact-listener.org/artifact/com.lazerycode.jmeter/…
标签: java maven jmeter jmeter-maven-plugin