Read test VM arguments from SBT file


I'm using the Play framework and when running tests we use a different play configuration file (application.conf). We do this currently by including the following line in our build.sbt file.

javaOptions in Test += "-Dconfig.file=conf/application.test.conf"

Is there a way to get IntelliJ to respect this configuration. Right now I have to manually change the test configuration in IntelliJ otherwise the tests run with the wrong configuration and fail.

I don't mind if I have to set another explicit property in build.sbt via something available through sbt-ide-settings.

1 comment


You can enable the "use sbt" option in the test run config, which will run the tests in the embedded sbt shell, and thus also respect the javaOptions configured from sbt


Please sign in to leave a comment.