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

查看:113
本文介绍了从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 s. 似乎就像Maven在执行JMeter时没有将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的版本,请参见此答案.

Although this answer is accepted, it only works for versions before 2.X. But for version higher than 2.X, see this answer.

是的,您可以通过向插件添加依赖项来添加所需的任何库,任何明确定义的依赖项都将复制到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天全站免登陆