gpt4 book ai didi

java - 执行 com.lazerycode.jmeter :jmeter-maven-plugin:2. 9.0:configure: net/minidev/asm/FieldFilter 时缺少必需的类

转载 作者:行者123 更新时间:2023-12-02 00:45:30 25 4
gpt4 key购买 nike

我将jmeter-maven-plugin 2.9.0ma​​ven 3.6.0一起使用,当我运行mvn verify时,出现以下错误:

Failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:2.9.0:configure (configure) on project performance-tests: Execution configure of goal com.lazerycode.jmeter:jmeter-maven-plugin:2.9.0:configure failed: A required class was mis sing while executing com.lazerycode.jmeter:jmeter-maven-plugin:2.9.0:configure: net/minidev/asm/FieldFilter

我在同一个项目上创建了一个 java 类,并导入了类 FieldFilter 并正常工作。

我尝试使用另一个版本的插件 2.8.5 进行验证,但出现了相同的错误。

POM内容:

<?xml version="1.0" encoding="UTF-8"?>
<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>performance-tests</groupId>
<artifactId>performance-tests</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<hostName>${hostName}</hostName>
<nrUsers>${nrUsers}</nrUsers>
<rampUpPeriod>${rampUpPeriod}</rampUpPeriod>
<jmeter-maven-plugin.version>2.9.0</jmeter-maven-plugin.version>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.11</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.jmeter/ApacheJMeter_core -->
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter_core</artifactId>
<version>5.1.1</version>
</dependency>

</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>${jmeter-maven-plugin.version}</version>
<configuration>
<generateReports>true</generateReports>
<errorRateThresholdInPercent>1</errorRateThresholdInPercent>
<testResultsTimestamp>false</testResultsTimestamp>
<propertiesUser>
<hostName>${hostName}</hostName>
<rampUpPeriod>${rampUpPeriod}</rampUpPeriod>
<threads>${nrUsers}</threads>
</propertiesUser>
<jmeterExtensions>
<artifact>kg.apc:jmeter-plugins-casutg:2.8</artifact>
</jmeterExtensions>
<excludedArtifacts>
<exclusion>org.slf4j:slf4j-nop</exclusion>
<exclusion>avalon-framework:*</exclusion>
<exclusion>org.apache.tika:*</exclusion>
<exclusion>excalibur-datasource:excalibur-datasource</exclusion>
<exclusion>excalibur-instrument:excalibur-instrument</exclusion>
<exclusion>excalibur-logger:excalibur-logger</exclusion>
<exclusion>excalibur-pool:*</exclusion>
<exclusion>org.beanshell:bsh:jar:2.0b5</exclusion>
</excludedArtifacts>
<jMeterProcessJVMSettings>
<arguments>
<argument>-XX:MaxMetaspaceSize=256m</argument>
<argument>-Xmx1024m</argument>
<argument>-Xms1024m</argument>
</arguments>
</jMeterProcessJVMSettings>
</configuration>
<executions>
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
<execution>
<id>jmeter-check-results</id>
<goals>
<goal>results</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>`

最佳答案

JMeter Maven Plugin丝毫不关心您在 <dependencies> 中指定的内容tag,它有自己的依赖解析和管理机制。

您需要将以下行添加到您的 pom.xml 文件中:

    </jMeterProcessJVMSettings>
<testPlanLibraries>
<artifact>net.minidev:asm:1.0.2</artifact>
</testPlanLibraries>
</configuration>

完成此操作后,JMeter Maven 插件会将 .jar 下载到 target/jmeter/lib文件夹,您将能够在测试中使用它。

更多信息:

关于java - 执行 com.lazerycode.jmeter :jmeter-maven-plugin:2. 9.0:configure: net/minidev/asm/FieldFilter 时缺少必需的类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57903060/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com