【发布时间】:2016-09-28 18:10:42
【问题描述】:
当你使用 sbt-native-packager 插件在 sbt 中打包一个命令行应用程序时,你会得到一个包含额外命令行选项的包装脚本,看起来像这样。
-h | -help print this message
-v | -verbose this runner is chattier
-d | -debug set sbt log level to debug
-no-version-check Don't run the java version check.
-mem <integer> set memory options in MB (default: , which is -Xms1024m -Xmx1024m -XX:MaxPermSize=256m -XX:ReservedCodeCacheSize=128m)
-jvm-debug <port> Turn on JVM debugging, open at the given port.
# java version (default: java from PATH, currently java version "1.7.0_21")
-java-home <path> alternate JAVA_HOME
# jvm options and output control
JAVA_OPTS environment variable, if unset uses ""
-Dkey=val pass -Dkey=val directly to the java runtime
-J-X pass option -X directly to the java runtime
(-J is stripped)
# special option
-- To stop parsing built-in commands from the rest of the command-line.
e.g.) enabling debug and sending -d as app argument
$ ./start-script -d -- -d
是否可以选择性地禁用其中一些选项或从打包的应用程序中将它们全部删除?
【问题讨论】:
-
也许您正在寻找自定义脚本模板的方法:scala-sbt.org/sbt-native-packager/archetypes/java_app/…
-
谢谢@shyam,我会看看这个选项。