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

查看:33
本文介绍了将 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 提供了在 maven pom 中嵌入 ant 任务的可能性.

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 发行版.

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

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天全站免登陆