jmeter-maven-plugin :如何在执行 mvn verify 时下载 jmeter testplan 使用的所需插件

jmeter-maven-plugin : how to download required plugin used by jmeter testplan when execute mvn verify

我在测试计划中使用非默认线程 group/plugins,当 运行 mvn clean verify maven 生成错误

missing class com.thoughtworks.xstream.converters.ConversionException:
[INFO] ---- Debugging information ----
[INFO] cause-exception     : com.thoughtworks.xstream.converters.ConversionException

但是在 maven 命令行控制台中我看到下载依赖项 = true

target\jmeter\lib\ext with downloadExtensionDependencies set to true ...
target\jmeter\lib\junit with downloadLibraryDependencies set to true
target\jmeter\lib with downloadLibraryDependencies set to true ...

这是我的pom.xml

<build>
        <plugins>
            <plugin>
                <groupId>com.lazerycode.jmeter</groupId>
                <artifactId>jmeter-maven-plugin</artifactId>
                <version>${jmeter.maven.plugin.version}</version>
                <configuration>
                    <testFilesIncluded>
                        <jMeterTestFile>google.jmx</jMeterTestFile>
                    </testFilesIncluded>
                </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>

问题:

  1. 我应该在 jmeter-maven-plugin 中添加什么才能下载所需的插件? (一般我们用jmeter plugin manager下载就UI)

如果您的测试依赖于 Custom Thread Groups,您将需要在 pom.xml 中添加几行以告知 JMeter Maven 插件下载并安装此插件,您的配置应如下所示:

<build>
    <plugins>
        <plugin>
            <groupId>com.lazerycode.jmeter</groupId>
            <artifactId>jmeter-maven-plugin</artifactId>
            <version>${jmeter.maven.plugin.version}</version>
            <configuration>
                <jmeterExtensions>
                    <artifact>kg.apc:jmeter-plugins-casutg:2.5</artifact>
                </jmeterExtensions>
                <testFilesIncluded>
                    <jMeterTestFile>google.jmx</jMeterTestFile>
                </testFilesIncluded>
            </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>

更多信息: