无法解决类异常:com.blazemeter.jmeter.controller.ParallelSampler
CannotResolveClassException: com.blazemeter.jmeter.controller.ParallelSampler
我 运行 遇到一个问题,基本上是 Gradle 找不到我在 gradle 文件中包含的 ParallelSampler class。
基本上,我正在尝试在我的项目中使用 blazemeter 开发的插件(ParallelSampler)。
我不确定为什么会这样。
import org.ajoberstar.grgit.Grgit;
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'groovy'
id 'org.ajoberstar.grgit' version '4.0.0'
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
compile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.16'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.10'
compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.12'
compile group: 'org.apache.jmeter', name: 'ApacheJMeter_core', version: '5.2.1'
compile group: 'org.apache.jmeter', name: 'ApacheJMeter_http', version: '5.2.1'
compile group: 'com.blazemeter', name: 'jmeter-parallel', version: '0.9'
}
task cloneJmeter() {
doFirst {
Grgit.clone {
dir = "apache-jmeter/"
uri = "https://github.com/apache/jmeter.git"
remote = "origin"
refToCheckout = "rel/v5.2.1"
}
}
}
sourceSets.main.resources.srcDirs = ["src/"]
task copyJar(type: Copy) {
from jar
into "apache-jmeter/lib/"
}
clean.doFirst {
delete "apache-jmeter"
}
我看到以下控制台日志
Cause:
00:38:46 CannotResolveClassException: com.blazemeter.jmeter.controller.ParallelSampler
00:38:46
00:38:46 Detail:com.thoughtworks.xstream.converters.ConversionException:
00:38:46 ---- Debugging information ----
00:38:46 cause-exception : com.thoughtworks.xstream.converters.ConversionException
00:38:46 cause-message :
00:38:46 first-jmeter-class : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
00:38:46 class : org.apache.jmeter.save.ScriptWrapper
00:38:46 required-type : org.apache.jmeter.save.ScriptWrapper
00:38:46 converter-type : org.apache.jmeter.save.ScriptWrapperConverter
00:38:46 path : /jmeterTestPlan/hashTree/hashTree/hashTree[5]/hashTree[4]/com.blazemeter.jmeter.controller.ParallelSampler
00:38:46 line number : 242
00:38:46 version : 5.2.1-SNAPSHOT
我想下载 jmeter-parallel jar 并存储到 jmeter 的 apache-jmer/lib/ext 中。
JMeter 插件需要进入 "lib/ext" folder 因此如果您将 jmeter-parallel-0.9.jar
文件放入“lib”文件夹 JMeter 将不会将其识别为插件
还要注意 JMeter Plugins Manager which provides possibility to install JMeter Plugins (along with their dependencies), the Plugins Manager has programmatic and command-line interfaces,因此您应该能够使用它从 Gradle build
中安装插件
我 运行 遇到一个问题,基本上是 Gradle 找不到我在 gradle 文件中包含的 ParallelSampler class。
基本上,我正在尝试在我的项目中使用 blazemeter 开发的插件(ParallelSampler)。
我不确定为什么会这样。
import org.ajoberstar.grgit.Grgit;
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'groovy'
id 'org.ajoberstar.grgit' version '4.0.0'
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
compile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.16'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.10'
compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.12'
compile group: 'org.apache.jmeter', name: 'ApacheJMeter_core', version: '5.2.1'
compile group: 'org.apache.jmeter', name: 'ApacheJMeter_http', version: '5.2.1'
compile group: 'com.blazemeter', name: 'jmeter-parallel', version: '0.9'
}
task cloneJmeter() {
doFirst {
Grgit.clone {
dir = "apache-jmeter/"
uri = "https://github.com/apache/jmeter.git"
remote = "origin"
refToCheckout = "rel/v5.2.1"
}
}
}
sourceSets.main.resources.srcDirs = ["src/"]
task copyJar(type: Copy) {
from jar
into "apache-jmeter/lib/"
}
clean.doFirst {
delete "apache-jmeter"
}
我看到以下控制台日志
Cause:
00:38:46 CannotResolveClassException: com.blazemeter.jmeter.controller.ParallelSampler
00:38:46
00:38:46 Detail:com.thoughtworks.xstream.converters.ConversionException:
00:38:46 ---- Debugging information ----
00:38:46 cause-exception : com.thoughtworks.xstream.converters.ConversionException
00:38:46 cause-message :
00:38:46 first-jmeter-class : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
00:38:46 class : org.apache.jmeter.save.ScriptWrapper
00:38:46 required-type : org.apache.jmeter.save.ScriptWrapper
00:38:46 converter-type : org.apache.jmeter.save.ScriptWrapperConverter
00:38:46 path : /jmeterTestPlan/hashTree/hashTree/hashTree[5]/hashTree[4]/com.blazemeter.jmeter.controller.ParallelSampler
00:38:46 line number : 242
00:38:46 version : 5.2.1-SNAPSHOT
我想下载 jmeter-parallel jar 并存储到 jmeter 的 apache-jmer/lib/ext 中。
JMeter 插件需要进入 "lib/ext" folder 因此如果您将 jmeter-parallel-0.9.jar
文件放入“lib”文件夹 JMeter 将不会将其识别为插件
还要注意 JMeter Plugins Manager which provides possibility to install JMeter Plugins (along with their dependencies), the Plugins Manager has programmatic and command-line interfaces,因此您应该能够使用它从 Gradle build
中安装插件