【问题标题】:Automation of JMeter tests using Maven使用 Maven 自动化 JMeter 测试
【发布时间】:2017-10-27 08:22:33
【问题描述】:

我在我的应用程序中包含了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 运行它?

【问题讨论】:

    标签: java maven automation jmeter jmeter-maven-plugin


    【解决方案1】:

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

    mvn jmeter:jmeter -Pjmeter
    

    参考资料:

    【讨论】:

    • [WARNING] The requested profile "jmeter" could not be activated because it does not exist.
    • 它没有解决我的问题,并添加了@JensPiegsa 评论的相同警告。
    猜你喜欢
    • 2016-05-19
    • 1970-01-01
    • 2012-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多