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

时间:2018-02-01 22:38:19

标签: jmeter jmeter-maven-plugin

运行时,我在测试计划中使用非默认线程组/插件 mvn clean verify maven生成错误

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

然而,在maven命令行控制台中,我看到了download dependency = 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插件管理器在UI上下载)

1 个答案:

答案 0 :(得分:1)

如果您的测试依赖于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>

更多信息: