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

查看:170
本文介绍了将文件夹中的所有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属性设置为以单个冒号分隔的(半)冒号列表,但是似乎不支持使用通配符.有什么办法可以将整个jars文件夹中的jar文件添加到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
  • 以上各项的任意组合.各个类路径条目需要用分号或冒号分隔,具体取决于底层操作系统
  • Single jar file: user.classpath=/Projects/junit/test1.jar
  • Multiple jar files: user.classpath=/Projects/junit/test1.jar;/Projects/junit/test2.jar
  • A folder: user.classpath=/Projects/junit
  • Any combination of the above. Individual classpath entries need to be separated by semicolon or colon depending on underlying operating system

该帖子是关于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天全站免登陆