小编Art*_*iom的帖子

如何在命令行中指定加特林的模拟类

我有简单的加特林项目和两个模拟类(SimulationForAzure.scala 和 OtherSimulation.scala)。当我只想选择一种模拟并尝试执行命令时

mvn -Dgatling.simulationClass=org.example.SimulationForAzure gatling:test
Run Code Online (Sandbox Code Playgroud)

或者

mvn gatling:test -Dgatling.simulationClass=org.example.SimulationForAzure
Run Code Online (Sandbox Code Playgroud)

我收到错误:

Unknown lifecycle phase ".simulationClass=org.example.SimulationForAzure". You must specify a valid lifecycle phase or a goal
Run Code Online (Sandbox Code Playgroud)

怎么了?以及如何在命令行中指定加特林的模拟类?

我的 pom.xml 是:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.example</groupId>
  <artifactId>untitled</artifactId>
  <version>1.0-SNAPSHOT</version>

  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <encoding>UTF-8</encoding>

    <gatling.version>3.3.1</gatling.version>
    <gatling-maven-plugin.version>3.0.5</gatling-maven-plugin.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.gatling.highcharts</groupId>
      <artifactId>gatling-charts-highcharts</artifactId>
      <version>${gatling.version}</version>
    </dependency>
    <dependency>
      <groupId>io.gatling</groupId>
      <artifactId>gatling-app</artifactId>
      <version>${gatling.version}</version>
    </dependency>
    <dependency>
      <groupId>io.gatling</groupId>
      <artifactId>gatling-recorder</artifactId>
      <version>${gatling.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>io.gatling</groupId>
        <artifactId>gatling-maven-plugin</artifactId>
        <version>${gatling-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins> …
Run Code Online (Sandbox Code Playgroud)

maven gatling

1
推荐指数
2
解决办法
1万
查看次数

标签 统计

gatling ×1

maven ×1