将JMeter集成为Maven项目的一部分 [英] Integrating JMeter as part of Maven project

查看:380
本文介绍了将JMeter集成为Maven项目的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开始与创建一些自定义的jmeter组件集相关的项目的工作,这些组件将捆绑在我的自定义jmeter发行版中.

I'm starting my work on the project related to creating some custom set of jmeter components that would be bundled in my custom jmeter distribution.

那些自定义组件是Maven项目的一部分,我想做的就是尝试将此Maven项目与最新的jmeter项目集成在一起,以便能够构建和交付jmeter构建,其中包含我的自定义组件集以及所有相关的依赖关系罐子.

Those custom components are part of the Maven project and what I would like to do is try to integrate this maven project with latest jmeter project to be able to build and deliver jmeter build that contains my custom set of components with all related dependency jars.

问题是jmeter项目是ant项目. 我遇到了这个问题: http://maven.apache.org/guides/mini/guide-using-ant.html ,maven-antrun-plugin,可以将ant任务嵌入到maven pom中.

Problem is that jmeter project is ant project. I've came across this: http://maven.apache.org/guides/mini/guide-using-ant.html, maven-antrun-plugin which gives a possibility to embed ant task inside the maven pom.

由于我从未使用过ant(仅使用过maven),因此在pom中使用此插件的想法是定义以下目标:

Since I've never worked with ant (only worked with maven), my idea of using this plugin inside pom would be to define following targets:

  1. 从svn存储库下载jmeter源
  2. 建立jmeter分布
  3. 在构建maven项目之后(在安装阶段之后),将jar(组件和依赖项jar)复制到jmeter库中,以与我的自定义组件一起形成最终的jmeter发行版.
  1. download jmeter source from svn repository
  2. build jmeter distribution
  3. after building maven project (after install phase), copy jars (component and dependency jars) to the jmeter lib to form the final jmeter distribution with my custom components.

我的问题是:您是否认为此方法是正确的方法(这样做时是否需要考虑一些事项),如果不能,您是否可以建议我其他实现同一目标的方法?

My question is: Do you find this approach as the right one (are there some things to consider while doing this) and if not, can you suggest me some other ways of achieving the same goal?

预先感谢

推荐答案

自JMeter 2.6起,Apache JMeter工件就发布在maven2存储库中.

Since JMeter 2.6, Apache JMeter artifacts are published on maven2 repositories.

请参阅:

查看示例:

因此,您可以做的是将自己的maven项目引用为依赖项.

So what you can do is have your maven project that references these artifacts as dependencies.

如果要生成包含JMETER + You插件的完整捆绑包,请使用AntRunner进行操作:

And if you want to generate a full bundle containing JMETER+You Plugins then use AntRunner to :

  • 解压缩官方发行版
  • 将您的工件复制到jmeter/lib/ext中,并将依赖项复制到jmeter/lib中
  • 将其压缩

这篇关于将JMeter集成为Maven项目的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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