简体   繁体   English

使用xsbt插件传递jvm选项

[英]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.

相关问题 使用xsbt-web-plugin请求Jetty容器的登录控制台 - Request log in console for Jetty container using xsbt-web-plugin 使用 xsbt-web-plugin 的 xsbt 0.10.x 在构建期间无法找到 org.eclipse.jetty - xsbt 0.10.x using xsbt-web-plugin fails to find org.eclipse.jetty during build 使用xsbt-web-plugin时,为什么在Sbt控制台中检查compile:packageWar :: packagedArtifact失败? - Why does inspect compile:packageWar::packagedArtifact fail in the Sbt console when using xsbt-web-plugin? 使用xsbt-web-plugin和JRebel时,SBT不会在webapp中传播更改 - SBT does not propagate changes in webapp when using xsbt-web-plugin and JRebel 如何使用xsbt-proguard-plugin排除/包含特定软件包? - How do I exclude/include specific packages using xsbt-proguard-plugin? SBT从使用xsbt-web-plugin打包的war文件中排除scala-library.jar - SBT exclude scala-library.jar from a war file packaged using xsbt-web-plugin SBT Xsbt-web插件找不到注释 - SBT Xsbt-web plugin not finding annotations 使用xsbt-web-plugin配置Lift:查找主要方法类 - Configuring Lift with xsbt-web-plugin: finding the main method class xsbt-web-plugin在sbt之外运行Webservelet容器? - xsbt-web-plugin Running the web servelet container outside of sbt? 如何设置码头端口xsbt插件1.0.0-M7 - How to set jetty port xsbt plugin 1.0.0-M7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM