How do I run an sbt main class from the shell as normal command-line program?

前端 未结 4 1701
轻奢々
轻奢々 2020-12-02 15:00

How can I run an sbt app from the shell, so that I can run my app as a normal command-line program (as if run directly via scala but without having to set up an

4条回答
  •  囚心锁ツ
    2020-12-02 15:30

    Just discovered the sbt start script plugin: https://github.com/typesafehub/xsbt-start-script-plugin:

    This plugin allows you to generate a script target/start for a project. The script will run the project "in-place" (without having to build a package first).

    The target/start script is similar to sbt run but it doesn't rely on SBT. sbt run is not recommended for production use because it keeps SBT itself in-memory. target/start is intended to run an app in production.

    The plugin adds a task start-script which generates target/start. It also adds a stage task, aliased to the start-script task.

提交回复
热议问题