[英]Passing jvm options using xsbt plugin
I want to pass an environment variable when running container:start from sbt. 我想在运行container:从sbt开始时传递一个环境变量。 So I have tried adding
所以我尝试添加
javaOptions in container := Seq("-Dmyvar=xxx")
to build.scala, as outlined in the xsbt plugin documentation. 按照xsbt插件文档中所述构建build.scala。 But this is having no effect when I run container:start.
但这在我运行container:start时没有任何效果。 Can someone suggest what I might be missing?
有人可以建议我可能缺少的东西吗?
Thanks Des 谢谢德斯
If you're using xsbt-web-plugin v1.0.x, then your approach is correct: 如果您使用的是xsbt-web-plugin v1.0.x,那么您的方法是正确的:
javaOptions in container := Seq("-Dmyvar=xxx")
You can find a working example of this option in the java-options test case. 您可以在java-options测试案例中找到此选项的有效示例。
EDIT: See also this example , which shows the above -Dmyvar=xxx
used with v1.0.0-M7 in a Scalatra environment. 编辑:另请参见本示例 , 该示例显示了以上
-Dmyvar=xxx
在Scalatra环境中与v1.0.0-M7一起使用。
With xsbt-web-plugin v0.9 and earlier, you'll need to pass your JVM argument directly to sbt: 使用xsbt-web-plugin v0.9及更早版本,您需要将JVM参数直接传递给sbt:
sbt -Dmyvar=xxx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.