从 Maven 执行时的 JMeter 插件 [英] JMeter Plugins when Executing from Maven

查看:23
本文介绍了从 Maven 执行时的 JMeter 插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JMeter 插件github.com/Ronnie76er/jmeter-maven-plugin/" rel="noreferrer">jmeter-maven-plugin?

Is it possible to use JMeter Plugins when executing JMeter from the jmeter-maven-plugin?

更新

我已经尝试根据 Ardesco 的有用答案将 jmeter-plugins 依赖项添加到插件定义中,但是我得到了无数的 ClassNotFoundException.在执行 JMeter 时,似乎 Maven 没有将 jmeter-plugin 的传递依赖项放在类路径上.有什么想法吗?

I've tried adding the jmeter-plugins dependency to the plugin definition as per Ardesco's helpful answer, but I get a myriad of ClassNotFoundExceptions. It seems like Maven is not putting jmeter-plugin's transitive dependencies on the classpath when executing JMeter. Any ideas?

推荐答案

虽然这个答案被接受,但它只适用于 2.X 之前的版本.但对于高于 2.X 的版本,请参阅此答案.

是的,您可以通过向插件添加依赖项来添加您需要的任何库,任何明确定义的依赖项都将复制到您的 jmeter/lib 目录中.

Yup, you can add any libraries you require by adding dependencies to the plugin, any explicitly defined dependencies will be copied to your jmeter/lib directory.

如果依赖项是 JMeter 插件,您可以在配置中指定它,然后该依赖项将被复制到您的 meter/lib/ext 目录:

If the dependency is a JMeter plugin you can specify this in your configuration and then that dependency will be copied to your meter/lib/ext directory:

<plugin>
    <groupId>com.lazerycode.jmeter</groupId>
    <artifactId>jmeter-maven-plugin</artifactId>
    <version>1.9.0</version>
    <executions>
        <execution>
            <id>jmeter-tests</id>
            <phase>verify</phase>
            <goals>
                <goal>jmeter</goal>
            </goals>
            <configuration>
                <jmeterPlugins>
                    <plugin>
                        <groupId>kg.apc</groupId>
                        <artifactId>jmeter-plugins</artifactId>
                    </plugin>
                </jmeterPlugins>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>kg.apc</groupId>
            <artifactId>jmeter-plugins</artifactId>
            <version>1.1.3</version>
        </dependency>
    </dependencies>
</plugin>

此功能在 1.9.0 版本之前已损坏.

This functionality was broken before version 1.9.0.

这篇关于从 Maven 执行时的 JMeter 插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆