How To Run Gatling Sbt jar from command line?


here is gatling sbt project for which i am trying to create and make a runnable jar

I have executed sbt then sbt assembly and able to generate a jar file my build.sbt is below


scalaVersion := “2.12.10”

scalacOptions := Seq(
“-encoding”, “UTF-8”, “-target:jvm-1.8”, “-deprecation”,
“-feature”, “-unchecked”, “-language:implicitConversions”, “-language:postfixOps”)

libraryDependencies += “io.gatling.highcharts” % “gatling-charts-highcharts” % “3.3.1” % “test,it”
libraryDependencies += “io.gatling” % “gatling-test-framework” %

“3.3.1” %
libraryDependencies += “com.amazonaws” % “aws-lambda-java-core” % “1.0.0”
libraryDependencies += “com.amazonaws” % “aws-lambda-java-events” % “1.0.0”

javacOptions ++= Seq("-source", “1.8”, “-target”, “1.8”, “-Xlint”)

lazy val root = (project in file(".")).
name := “lambda-demo”,
version := “1.0”,
scalaVersion := “2.12.10”,
retrieveManaged := true,
libraryDependencies += “com.amazonaws” % “aws-lambda-java-core” % “1.0.0”,
libraryDependencies += “com.amazonaws” % “aws-lambda-java-events” % “1.0.0”

mergeStrategy in assembly :=
case PathList(“META-INF”, xs @ _*) => MergeStrategy.discard
case x => MergeStrategy.first

when i type java -jar lambda-demo-assembly-1.0.jar from command line i get below error ,how do i resolve it,basically my goal is to run gatling sbt simulation using jar

no main manifest attribute, in lambda-demo-assembly-1.0.jar

The command to run gatling simulation class is

gatling:testOnly computerdatabase.BasicSimulation

so instead of above command i would like to run tests using jar file

Here is simulation class

package computerdatabase

import scala.concurrent.duration._

import java.util.concurrent.ThreadLocalRandom

import io.gatling.core.Predef._
import io.gatling.http.Predef._

class ComputerWorld extends Simulation {

val httpProtocol = http

.acceptEncodingHeader(""“gzip, deflate”"")
.userAgentHeader(""“Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0)
Gecko/20100101 Firefox/31.0"”")

val computerDbScn = scenario(“Computer Scenario”)
status is 200,
regex("""\d+ computers found"""),
css("#add", “href”).saveAs(“addComputer”)))

.check(substring(“Add a computer”)))

.formParam(“name”, “${homeComputer}”)
.formParam(“introduced”, “2015-10-10”)
.formParam(“discontinued”, “2017-10-10”)
.formParam(“company”, “”)

constantUsersPerSec(2) during(1 minute)