Gatling Maven exception

784 views
Skip to first unread message

Sheron Sgj

unread,
Oct 5, 2021, 1:17:44 AM10/5/21
to Gatling User Group
Hi Team, 

New to Gatling as well as Maven. When I call the simulation class through CLI. I'm getting a maven lifecycle exception message. 

Command 
mvn gatling:test -Dgatling.simulationClass=simulationOne

Error Message 
Unknown lifecycle phase ".simulationClass= simulationOne". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifec
ycle phases are: validate, initialize, generate-sources, 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, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [H
elp 1]

POM.xml 
<dependencies>
<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-app</artifactId>
<version>${gatling.version}</version>
</dependency>
<dependency>
<groupId>io.gatling</groupId>
<artifactId>gatling-recorder</artifactId>
<version>${gatling.version}</version>
</dependency>
</dependencies>

<build>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<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>
</build>

Stéphane LANDELLE

unread,
Oct 5, 2021, 2:01:09 AM10/5/21
to gat...@googlegroups.com
I suspect you have non-printable characters in your command, maybe because you've copy-pasted it from somewhere else.
Try typing characters manually.


--

Stéphane Landelle

Chief Technical Officer

   

slan...@gatling.io
gatling.io
   
facebook twitter linkedin 


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/0b9a6b1b-4411-4e21-84d6-997daa851415n%40googlegroups.com.

Sheron Sgj

unread,
Oct 5, 2021, 3:05:03 AM10/5/21
to Gatling User Group
Stephane, 

I manually type the command, but still facing the same error. 

Path of the simulation class
src/test/scala/simulationOne.scala

Error message
 Unknown lifecycle phase ".simulationClass= simulationOne". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifec
ycle phases are: validate, initialize, generate-sources, 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, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [H
elp 1]


Stéphane LANDELLE

unread,
Oct 5, 2021, 3:09:20 AM10/5/21
to gat...@googlegroups.com
Sorry, no idea what goes wrong on your side.
Check the official sample and you'll see the command works just fine: https://github.com/gatling/gatling-maven-plugin-demo


--

Stéphane Landelle

Chief Technical Officer

   

slan...@gatling.io
gatling.io
   
facebook twitter linkedin 

Sheron Sgj

unread,
Oct 7, 2021, 1:31:28 AM10/7/21
to Gatling User Group
@Stéphane Landelle

When I ran the below command it ran fine. 

mvn gatling:test -D"gatling.simulationClass= simulationOne"

Any reason for this. 
Reply all
Reply to author
Forward
0 new messages