user79074
user79074

Reputation: 5280

Passing jvm options using xsbt plugin

I want to pass an environment variable when running container:start from sbt. So I have tried adding

 javaOptions in container := Seq("-Dmyvar=xxx")

to build.scala, as outlined in the xsbt plugin documentation. But this is having no effect when I run container:start. Can someone suggest what I might be missing?

Thanks Des

Upvotes: 0

Views: 427

Answers (1)

earldouglas
earldouglas

Reputation: 13473

If you're using xsbt-web-plugin v1.0.x, then your approach is correct:

javaOptions in container := Seq("-Dmyvar=xxx")

You can find a working example of this option in the java-options test case.

EDIT: See also this example, which shows the above -Dmyvar=xxx used with v1.0.0-M7 in a Scalatra environment.

With xsbt-web-plugin v0.9 and earlier, you'll need to pass your JVM argument directly to sbt:

sbt -Dmyvar=xxx

Upvotes: 2

Related Questions