Common SBT commands (Scala SBT)

I had the common Scala SBT commands in the notes for my project named SARAH, and thought I'd list them here to make them easier to find:

clean            Deletes all generated files (in the target directory).

compile          Compiles the main sources (in src/main/scala and src/main/java directories).

test             Compiles and runs all tests.

console          Starts the Scala interpreter with a classpath including the compiled sources and
                 all dependencies. To return to sbt, type :quit, Ctrl+D (Unix), or Ctrl+Z (Windows).

run <argument>*  Runs the main class for the project in the same virtual machine as sbt.

package          Creates a jar file containing the files in src/main/resources and the classes compiled
                 from src/main/scala and src/main/java.

help <command>   Displays detailed help for the specified command. If no command is provided, displays
                 brief descriptions of all commands.

reload           Reloads the build definition (build.sbt, project/*.scala, project/*.sbt files).
                 Needed if you change the build definition.

Add new comment

The content of this field is kept private and will not be shown publicly.

Anonymous format

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul type> <ol start type> <li> <pre>
  • Lines and paragraphs break automatically.