Passing Duration as properties to gatling-maven-plugin

I have been passing properties to Gatling using the gatling-maven-plugin for a long time and it works flawlessly. However, I have stumbled upon an issue that I cannot seem to get around:

I basically want to pass my setUp() from the command line to Gatling.

So this works:

numUsers = System.getProperty("mytest.numUsers").asInstanceOf[Int]

…however this does not:

pauseTime = Duration.apply(System.getProperty("mytest.pauseTime"))

To answer your first question, this excerpt is part of a case class, so no vals in the lines above.

Validating the code using the Scala console works fine - I can set the system property, read it back and apply the string and get a Duration without any issues. It is providing the duration as a string (“1 second”) on the command line that is a problem to me right now.

I have tried passing the following:
-Dmytest.pauseTime="1 second"
or…
"-Dmytest.pausetime=1 second"
Result:

[INFO] — gatling-maven-plugin:3.0.3:test (default-cli) @ userinput —
14:46:53.904 [ERROR] i.g.a.Gatling$ - Run crashed
java.lang.NumberFormatException: format error “1 second”
at scala.concurrent.duration.Duration$.apply(Duration.scala:69)
at mypackage.config.Scenarios$.(Scenarios.scala:79)
at mypackage.config.Scenarios$.(Scenarios.scala)
… 17 common frames omitted
Wrapped by: java.lang.ExceptionInInitializerError: null
at mypackage.UserInputSimulation.(UserInputSimulation.scala:18)
… 16 common frames omitted

-Dmytest.pauseTime=1\ second
Result:

[ERROR] Unknown lifecycle phase “second”. You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle 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. → [Help 1]
org.apache.maven.lifecycle.LifecyclePhaseNotFoundException: Unknown lifecycle phase “second”. You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle 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.

Does anyone have any pointers for me here?

Thanks,
Håkan

The best you can do is

pauseTime = System.getProperty("mytest.pauseTime").toInt seconds