[Newbie] Can't find Run as -> Scala Application in Maven Gatling Project

614 views
Skip to first unread message

Miller C

unread,
Mar 1, 2016, 12:16:27 PM3/1/16
to Gatling User Group
I am a newbie to Gatling.   I have created a Maven Gatling project in Eclipse.  I would like to run Gatling recorder from eclipse, but I can't really figure out how to do that...even after reading all the documentation and searching around in past few days, I can't find a clear instruction on how to do it...   So I need a help from here.  

Below steps is what I have done so far, 

- Win 7 
- Eclipse version :  Mars 4.5
- Installed Scala IDE 4.3
- Installed Maven Integration for Scala IDE 0.5.1
- Installed Scala 2.11.7
- Added Maven Remote Catalog in Eclipse for Gatling Archetype by using : http://repository.excilys.com/content/groups/public/archetype-catalog.xml  
       to update Gatling Archetype from 2.0.0.M3 to 2.2.0.M-2
- And replace the  Engine.scala, IDEPathHelper.scala, Recorder.scala files from this site (https://github.com/gatling/gatling-maven/tree/gatling-maven-parent-2.1.1/gatling-highcharts-maven-archetype/src/main/scala)

after done these steps, I have tried to right click on scr/test/scala/Recorder.scala -> Run As -> (Run Configuration), there is no "Scala Application" option as I have seen many posts said to do.  I know it's either I have missed any steps or it will be done in different ways that I don't know about it.  

So please advise me how to trigger the Recorder UI from where I am now, and further settings need to be done.  I have been googling and searching from youtube, however, I can't find any tutorial that is for basic setting for newbie like me to start with.   

Big thanks in advance~ 


Miller C

unread,
Mar 14, 2016, 12:56:12 PM3/14/16
to Gatling User Group
Never mind, I have found the solution of replacing the right pom.xml for me.   Then it's working fine.  

morten bjoernsvik

unread,
Mar 15, 2016, 5:59:48 AM3/15/16
to Gatling User Group
Hi

Recommend running maven from the command line, after you have generated the pom from the archetype, set your own artifactid and package.
Just add a path to the maven included with your IDE, or install it yourselves and set MAVEN_HOME
(on ubuntu I use 'update-alternatives --config mvn' to manage several version of maven installed, like for java jvms)

mvn archetype:generate -DarchetypeGroupId=io.gatling.highcharts \
 -DarchetypeArtifactId=gatling-highcharts-maven-archetype -DinteractiveMode=false \
 -DarchetypeVersion=2.1.7 -DgroupId=io.gatling.highcharts \
 -DartifactId=gatlingtest -Dpackage=org.test

Then I add maven-surefire-plugin and skip unit-tests to run gatling in the verify lifecycle

mvn clean verify

This is very recommented if you need to run them in a CI environment like Jenkins, where you
are not guided by your IDE.

Below is my entire build which is the only think I change in the pom generated above.

    <build>
        <testSourceDirectory>src/test/scala</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <!-- we do not run init-tests here only integrationtests -->
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>

            <plugin>
                <groupId>io.gatling</groupId>
                <artifactId>gatling-maven-plugin</artifactId>
                <version>${gatling.version}</version>
                <!-- optional if you only have one simulation -->
                <configuration>
                    <configFolder>src/test/resources</configFolder>
                    <dataFolder>src/test/resources/data</dataFolder>
                    <resultsFolder>target/gatling/results</resultsFolder>
                    <bodiesFolder>src/test/resources/bodies</bodiesFolder>
                    <simulationsFolder>src/test/scala</simulationsFolder>
                    <!--    <noReports>false</noReports> -->
                    <!--   <reportsOnly>directoryName</reportsOnly> -->
                    <!--   <simulationClass>foo.Bar</simulationClass> -->
                    <!--   <jvmArgs> -->
                    <!--     <jvmArg>-DmyExtraParam=foo</jvmArg> -->
                    <!--   </jvmArgs> -->
                    <!--    <fork>true</fork> -->
                    <!--    <propagateSystemProperties>true</propagateSystemProperties> -->
                    <!--   <failOnError>true</failOnError> -->
                </configuration>
                <executions>
                    <execution>
                        <!-- run with mvn clean verify -->
                        <phase>integration-test</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
Reply all
Reply to author
Forward
0 new messages