Why does the "sbt stage" fail with an invalid command?

I get errors when I try to run my application using the 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] ^ 

I did this hundreds of times on other machines without any problems. I have SBT 0.13.5 - has anyone seen this before? I read this other post , but I'm not on Herek. Thanks.

+5
source share
2 answers

After the comments above , I realized that you just wanted to have the stage command, without bringing all the Play foo.

The stage command is part of sbt-native-packager , which:

The goal of the [plugin] is to integrate Scala software created using SBT for their own packaging systems, such as deb, rpm, homebrew, msi.

One of the features of the sbt-native-packager plugin is the stage command , which

 > help stage Create a local directory with all the files laid out as they would be in the final distribution. 

Just add the following to project/plugins.sbt so that the plugin is available in the project (after the comment from Muki , this example uses the latest version 1.0.0-M1 with autostart function):

 addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.0-M1") 

You also need to add the following to build.sbt :

 enablePlugins(JavaAppPackaging) 

And this! Now everything is ready.

Run 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 
+10
source

After many digging, I found out that the "stage" is implemented by the plugin from the "Presentation Form" , which I use in other projects and explains why sbt accepted the stage command.

0
source

Source: https://habr.com/ru/post/1205388/


All Articles