【问题标题】:running a gatling simulation in cmd with mvn使用 mvn 在 cmd 中运行加特林模拟
【发布时间】:2021-09-04 11:09:47
【问题描述】:

我试图在 jenkins 中运行一个加特林模拟,我发现我可以使用以下命令在 cmd 中运行它: mvn gatling:simulations.mySimulationName 我已经安装了 maven 和 gatling,当我使用 mvn -v 时,我得到了我的版本号,但是如果我尝试执行上面的命令,我会收到这条消息:

[ERROR] No plugin found for prefix 'gatling' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\myUser\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]

我不明白如何将 gatling 插件安装到 maven 中,有人可以帮我吗? 谢谢

【问题讨论】:

    标签: maven jenkins gatling


    【解决方案1】:

    首先,No plugin found for prefix 'gatling' 错误表示您尚未在 maven 项目中配置 gatling-maven-plugin

    那么,你的命令是错误的,应该是mvn gatling:test -Dgatling.simulationClass=simulations.mySimulationName

    你真的应该花点时间阅读official documentation

    此外,您绝对不能将 maven 与 maven 项目以外的东西一起使用,尤其是与 Gatling 捆绑包一起使用。您必须将您的测试源移动到正确的结构中,例如our official sample

    【讨论】:

    • 我没有 maven 项目,我只是想从 jenkins 在 cmd 中运行它我没有任何 maven 项目,模拟在 gatling 文件夹中,它是使用 recorder.bat 从 HAR 文件转换而来的文件就是这样。
    • 我已经编辑了我的答案。你试图做的事情不可能奏效。 maven 仅适用于 maven 项目。
    猜你喜欢
    • 2016-11-07
    • 1970-01-01
    • 1970-01-01
    • 2019-03-06
    • 2020-04-22
    • 2019-07-18
    • 1970-01-01
    • 1970-01-01
    • 2015-09-13
    相关资源
    最近更新 更多