将文件夹中的所有 jar 添加到 jmeter 类路径 [英] Add all jars from a folder to jmeter classpath

查看:26
本文介绍了将文件夹中的所有 jar 添加到 jmeter 类路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 CI 服务器将多个应用程序 jar 及其各种依赖项转储到一个文件夹中.我正在尝试使用 jmeter 类路径中的所有 jar 运行 jmeter 测试.

I have a CI server dumping several application jars and their various dependencies in a single folder. I'm trying to then run a jmeter test with all the jars in jmeter's classpath.

我可以将 jmeter 的 user.classpath 属性设置为(分号)冒号分隔的单个 jar 列表,但似乎不支持使用通配符.有没有办法可以将整个文件夹的 jars 添加到 jmeter 的类路径?

I can set jmeter's user.classpath property to a (semi-)colon separated list of individual jars, but using a wild card doesn't seem to be supported. Is there a way I can add the entire folder worth of jars to jmeter's classpath?

推荐答案

根据 如何使用 JUnit 和 JMeter 指南:

您还可以通过user.classpath"属性告诉"JMeter 查看其他位置.此属性位于 JMeter 安装的/bin 文件夹下的user.properties"文件中.它可以采用以下值:

You can also "tell" JMeter to look into additional locations via the "user.classpath" property. This property lives in the "user.properties" file under the /bin folder of your JMeter installation. It can take the following values:

  • 单个 jar 文件:user.classpath=/Projects/junit/test1.jar
  • 多个jar文件:user.classpath=/Projects/junit/test1.jar;/Projects/junit/test2.jar
  • 文件夹:user.classpath=/Projects/junit
  • 以上任意组合.各个类路径条目需要用分号或冒号分隔,具体取决于底层操作系统

这篇文章是关于 JUnit 的,但是类加载和类路径配置适用于任何外部 .jar 文件.

The post is about JUnit, however class loading and classpath configuration is applicable to any external .jar files.

请记住,更改类路径不是动态过程,您需要重新启动 JMeter 才能选择任何新 jar 或属性更改.

Remember that changing classpath is not dynamic process and you'll need to restart JMeter in order to pick any new jars or a property change.

这篇关于将文件夹中的所有 jar 添加到 jmeter 类路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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