Hi, guys.
I want to pass some parameters to maven from Jenkins. But when set goal :
mvn clean install JAVA_OPTS=“-DnbUsers=3 -DmyRamp=60” gatling:execute -Dgatling.simulationClass=com.deloi
tte.performance.simulations.TestLoginLogout
I got next message:
Unknown lifecycle phase “JAVA_OPTS=-DnbUsers=3 -DmyRamp=60”. You must specify a valid lifecycle phase or a goal in the format <plugin-pref
: or :[:]:. Available lifecycle phases are: validate, initialize, generate-sou
rces, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test
-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, po
st-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. → [Help 1]
What am I doing wrong?
my pom.xml:
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.performance</groupId>
<artifactId>performance</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>performance</name>
<properties>
<gatling.version>2.2.4</gatling.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<encoding>UTF-8</encoding>
<scala.version>2.11.8</scala.version>
<scala.compat.version>2.11</scala.compat.version>
</properties>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<!-- Test dependencies. -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.specs2</groupId>
<artifactId>specs2-core_${scala.compat.version}</artifactId>
<version>3.7.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.specs2</groupId>
<artifactId>specs2-junit_2.11</artifactId>
<version>3.7.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.gatling.highcharts</groupId>
<artifactId>gatling-charts-highcharts</artifactId>
<version>${gatling.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.gatling</groupId>
<artifactId>gatling-test-framework</artifactId>
<version>${gatling.version}</version>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.11</artifactId>
<version>3.0.0-M7</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
<configuration>
<args>
<!--<arg>-target:jvm-1.8</arg>-->
<arg>-deprecation</arg>
<arg>-feature</arg>
<arg>-unchecked</arg>
<arg>-language:implicitConversions</arg>
<arg>-language:postfixOps</arg>
</args>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<version>${gatling.version}</version>
<executions>
<execution>
<configuration>
<configFolder>src/test/resources</configFolder>
<dataFolder>src/test/resources/data</dataFolder>
<resultsFolder>src/test/results</resultsFolder>
<simulationsFolder>src/test/simulations</simulationsFolder>
<runMultipleSimulations>true</runMultipleSimulations>
<jvmArgs>
<jvmArg>-Durl=http://localhost:9000</jvmArg>
<jvmArg>-DnbUser=1</jvmArg>
<jvmArg>-DnumberOfRepetitions=-1</jvmArg>
<jvmArg>-DmyRamp=10</jvmArg>
<jvmArg>-DpauseBetweenRequestsMs=3000</jvmArg>
<jvmArg>-Ddebug=true</jvmArg>
</jvmArgs>
<propagateSystemProperties>true</propagateSystemProperties>
</configuration>
<goals>
<goal>execute</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<fork>true</fork>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<systemProppertyVariables>
<nbUser>5</nbUser>
<myRamp>10</myRamp>>
</systemProppertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</project>