本文介绍了无法使用Maven解决Apache JMTER 2.13的罐子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用Java代码运行jmeter脚本.我已经做了一个jmx.我在尝试运行代码时使用jmeter 2.13,它向我显示此错误.
I am trying to run jmeter script using java code. I already made one jmx. Iam using jmeter 2.13 when I tried to run the code it is showing me this error.
我的pom.xml
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>JmeterJson</groupId>
<artifactId>JmeterJson</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<spring.version>4.0.0.RELEASE</spring.version>
<jdk.version>1.8</jdk.version>
<jackson.version>1.9.10</jackson.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter_core</artifactId>
<version>2.13</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter_http</artifactId>
<version>2.13</version>
<exclusions>
<exclusion>
<artifactId>commons-math3</artifactId>
<groupId>commons-math3</groupId>
</exclusion>
<exclusion>
<artifactId>commons-pool2</artifactId>
<groupId>commons-pool2</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Jackson JSON Mapper -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.10</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.4.4</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.10.1</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
之前,当我不添加jmeter jar时,它工作正常.
Before, when I didn't add jmeter jar, it was working fine.
推荐答案
编辑2017年11月:
Edit November 2017:
- JMeter Maven插件的最新版本2.5.1现在与JMeter 3.3兼容,因此最可行的修补程序是升级.
这是由于JMeter 2.13 pom中的一个问题,该问题已在每晚版本中修复:
This is due to an issue in JMeter 2.13 pom which is fixed in nightly build:
将此添加到JMeter依赖项中:
Add this into JMeter dependency:
<exclusions>
<exclusion>
<artifactId>commons-math3</artifactId>
<groupId>commons-math3</groupId>
</exclusion>
<exclusion>
<artifactId>commons-pool2</artifactId>
<groupId>commons-pool2</groupId>
</exclusion>
</exclusions>
并添加:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>2.3</version>
</dependency>
这篇关于无法使用Maven解决Apache JMTER 2.13的罐子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!