我正在尝试使用maven POM.xml运行jmx文件,即src/test/j测量仪,但是正在出错。
我已经在pom.xml中提供了5.1.1版本,仍然说这个插件需要5.1.1版本的jmeter。
这个插件会自动下载j量表吗?还是必须手动下载并保存在src/test/src文件夹中?
版本使用如下:
<dependency>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.9.0</version>
</dependency>尝试使用更改版本的jmeter maven插件,仍然会出现相同的错误。
这是当我在maven代码下面运行时遇到的错误: mvn干净安装-DskipTests -Dskip.report.generation=true -Djmeter.version=5.1.1
[ERROR] Failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:2.9.0:jmeter (jmeter-tests) on project WebserviceAutomation: The plugin com.lazerycode.jmeter:jmeter-maven-plugin:2.9.0 requires Maven version 3.5.2发布于 2019-10-24 07:06:29
根据JMeter Maven插件文档的当前版本
最新版本是2.9.0,它需要Maven >= 3.5.2,默认为Apache 5.1.1。
因此,请确保获得Maven 3.5.2或仅获得最新版本
最小的工作文件应该是这样的:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>jmeter-maven</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>maven-jmeter-demo</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.9.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>
</plugin>
</plugins>
</build>
</project>只需创建src/test/jmeter文件夹并将您的JMX脚本放在那里,一旦完成,您应该能够使用mvn verify命令启动测试。
https://stackoverflow.com/questions/58535279
复制相似问题