gpt4 book ai didi

sbt - 为什么 "sbt stage"失败并显示无效命令?

转载 作者:行者123 更新时间:2023-12-04 13:26:59 30 4
gpt4 key购买 nike

当我尝试使用 sbt clean compile stage 暂存我的应用程序时出现错误:

[error] Not a valid command: stage
[error] Not a valid project ID: stage
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: stage
[error] stage
[error] ^

我已经在其他机器上做了数百次没有问题。我有 SBT 0.13.5 - 有没有人见过这个?我已阅读 this other post ,但我不在 Heroku 上。谢谢。

最佳答案

the comments above我意识到你只是想拥有 stage命令而不带整个 Play foo 。
stage命令是 sbt-native-packager 的一部分那:

The goal [of the plugin] is to be able to bundle up Scala software built with SBT for native packaging systems, like deb, rpm, homebrew, msi.



sbt-native-packager 插件的功能之一是 the stage command
> help stage
Create a local directory with all the files laid out as they would be in the final distribution.

只需将以下内容添加到 project/plugins.sbt在项目中使用插件(在 the comment of Muki 之后,示例使用 the latest version 1.0.0-M1 和自动插件功能):
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.0-M1")

您还必须将以下内容添加到 build.sbt :
enablePlugins(JavaAppPackaging)

就是这样!你现在都准备好了。

执行 stage .
> stage
[info] Packaging /Users/jacek/dev/sandbox/command-build-scala/target/scala-2.10/command-build-scala_2.10-0.1-SNAPSHOT-sources.jar ...
[info] Done packaging.
[info] Updating {file:/Users/jacek/dev/sandbox/command-build-scala/}command-build-scala...
[info] Wrote /Users/jacek/dev/sandbox/command-build-scala/target/scala-2.10/command-build-scala_2.10-0.1-SNAPSHOT.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Packaging /Users/jacek/dev/sandbox/command-build-scala/target/scala-2.10/command-build-scala_2.10-0.1-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[info] Packaging /Users/jacek/dev/sandbox/command-build-scala/target/scala-2.10/command-build-scala_2.10-0.1-SNAPSHOT.jar ...
[info] Done packaging.
[success] Total time: 0 s, completed Nov 5, 2014 2:55:55 PM

关于sbt - 为什么 "sbt stage"失败并显示无效命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26535343/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com