gpt4 book ai didi

java - 使用 Maven 自动化 JMeter 测试

转载 作者:行者123 更新时间:2023-11-30 06:42:26 25 4
gpt4 key购买 nike

我已经在我的应用程序中包含了通过lazycode 实现的JMeter 插件。

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.1.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>

当我使用mvn verify时,它会运行。但是,它也运行所有集成测试和单元测试。我不希望这种事发生。我只想运行 mvn jmeter:jmeter 并运行性能测试。

如果我运行mvn jmeter:jmeter,我会得到

No plugin found for prefix 'jmeter' in the current project and in the plugin groups [org.sonarsource.scanner.maven, org.apache.maven.plugins, org.codehaus.mojo] available from the repositories

我不想配置全局 .m2/settings.xml。如何使用 Maven 运行它?

最佳答案

您已经快到了,运行 JMeter 测试的正确 Maven 命令是:

mvn jmeter:jmeter -Pjmeter

引用文献:

关于java - 使用 Maven 自动化 JMeter 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44201597/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com