Jar gatling project with java arguments

Hello All,

I am trying to generate the jar of my gatling project, I would like to know how to send jvm arguments to the jar, since when I run it with the arguments I get null pointer exception, so I have in my project the variables that I want it to receive via the command line.

public class E11Simulation extends Simulation {

    static String acta = System.getProperty("acta");
    String usuario = System.getProperty("usuario");
    String password = System.getProperty("password");
    int nbUsers = Integer.getInteger("users", 1);
    long myRamp = Long.getLong("ramp", 1);

and this is the result that it shows me in the console

These are the versions I’m using


I Hope can you help me


Running example with Maven:

mvn gatling:test -DRAMP_DURATION"="60"

… with in the source code example:

public static final Duration RAMP_DURATION = Duration
			.ofSeconds(Integer.parseInt(System.getProperty("RAMP_DURATION", "1")));

And don’t forget the maven configuration because here the simulation test class is not indicated in the maven command:


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.