Questions tagged [sbt]

sbt is an open source build tool for Scala and Java projects, similar to Java's Maven or Ant.

  • Fast and unintrusive to build simple projects.
  • Supports multiple projects/modules, external projects and other advanced setups.
  • Configuration, customization, and extension are done in Scala.
  • Dependency management support: inline declarations, external Ivy or Maven configuration files, and manual library management.
  • Supports mixed Scala/Java projects, packages jars, generates documentation with scaladoc.
  • Plugin framework for customized integrations (i.e. web app servers, IDEs, ORMs).
  • Supports testing with ScalaCheck, specs, and ScalaTest (JUnit is supported by a plugin).
  • Continuous compilation and testing with triggered execution.
  • Accurate recompilation is done using information extracted from the compiler.
  • Starts the Scala REPL with project classes and dependencies on the classpath.
  • Parallel task execution, including parallel test execution.

Official repository at GitHub

Official website

Stack Overflow sbt Tutorial

  1. General
  2. Dependency management
  3. Multiproject builds with .sbt files
  4. Publishing
  5. Cross-building
  6. Logging
  7. Using plugins
  8. sbt-assembly
  9. Developing tasks
  10. Developing plugins
  11. Developing commands
  12. Outside sbt
9905 questions
356
votes
10 answers

How can I check the SBT version?

How do I check which version of SBT I'm running? I have the Bash file set up that uses sbt-launch.jar, and it works, but sbt version only shows the "project version" (0.1) and sbt --version does nothing.
jpswain
  • 14,642
  • 8
  • 58
  • 63
197
votes
5 answers

ScalaTest in sbt: is there a way to run a single test without tags?

I know that a single test can be ran by running, in sbt, testOnly *class -- -n Tag Is there a way of telling sbt/scalatest to run a single test without tags? For example: testOnly *class -- -X 2 it would mean "run the second test in the class.…
Nacht
  • 10,488
  • 8
  • 31
  • 39
185
votes
3 answers

How to "re-run with -deprecation for details" in sbt?

When I compile Scala code, by running sbt compile, SBT says: $ sbt compile ... [warn] there were 5 deprecation warnings; re-run with -deprecation for details ... How do I do that? (From within SBT?)
KajMagnus
  • 11,308
  • 15
  • 79
  • 127
183
votes
2 answers

Build.scala, % and %% symbols meaning

I'm new to Play! Framework 2.1 (java version) and have no experience with scala. I don't understand what are and what does % and %% mean in Build.scala. I googled about them but couldn't find their meaning. In my Build.scala file I…
Franco
  • 11,845
  • 7
  • 27
  • 33
158
votes
4 answers

sbt-assembly: deduplication found error

I am not sure whether mergestrategy or exclude jars is the best option here. Any help with how do I proceed further with this error will be great! [sameert@pzxdcc0151 approxstrmatch]$ sbt assembly [info] Loading project definition from…
user3803714
  • 5,269
  • 10
  • 42
  • 61
154
votes
5 answers

How to access test resources in Scala?

I have a file data.xml in src/test/resources/. How can I read that file into a new FileReader in my test data.scala in src/test/scala/?
Aaron Yodaiken
  • 19,163
  • 32
  • 103
  • 184
152
votes
2 answers

Pros and cons of using sbt vs maven in Scala project

Which build tool is the best for Scala? What are the pros and cons of each of them? How to I determine which one of them to use in a project?
Konstantin Solomatov
  • 10,252
  • 8
  • 58
  • 88
149
votes
7 answers

How to create SBT project with IntelliJ Idea?

I just got started with Scala/LiftWeb/Sbt developing, and I'd like to import a Sbt project in IntelliJ Idea. Actually, I managed to import my project in two different ways: 1) with Maven. I created a Maven project, and of top of that I created a Sbt…
ksemeks
  • 1,778
  • 3
  • 15
  • 17
141
votes
15 answers

Debugging Scala code with simple-build-tool (sbt) and IntelliJ

What's the easiest way to debug Scala code managed by sbt using IntelliJ's built-in debugger? The documentation from "RunningSbt" from sbt's google code site lists commands for running the main class for a project or the tests, but there seem to be…
Matthew
  • 2,151
  • 2
  • 17
  • 13
132
votes
5 answers

How to force IntelliJ IDEA to reload dependencies from build.sbt after they changed?

I'm using IntelliJ IDEA 13 (Community Edition) with the Scala plugin. My initial import of an existing Scala project with a build.sbt worked fine. The library dependencies were picked up by IDEA. Additional dependencies added after the initial…
David B.
  • 5,700
  • 5
  • 31
  • 52
129
votes
9 answers

stuck at "Getting org.scala-sbt sbt 0.13.6 ..." when running sbt in terminal

Similar problem with How to use sbt behind authenticated proxy?. I tried with the given answer and problem still there. When I run sbt in terminal, it shows and stucks at : Getting org.scala-sbt sbt 0.13.6 ... additional information: sbt…
HappyCoding
  • 5,029
  • 7
  • 31
  • 51
127
votes
4 answers

SBT stop run without exiting

How do you terminate a run in SBT without exiting? I'm trying CTRL+C but it exits SBT. Is there a way to only exit the running application while keeping SBT open?
dsg
  • 12,924
  • 21
  • 67
  • 111
115
votes
7 answers

How to see dependency tree in sbt?

I am trying to inspect the SBT dependency tree as described in the documentation: sbt inspect tree clean But I get this error: [error] inspect usage: [error] inspect [uses|tree|definitions] Prints the value for 'key', the defining scope,…
Cherry
  • 31,309
  • 66
  • 224
  • 364
115
votes
11 answers

What's the reason for "Error:Cannot determine Java VM executable in selected JDK"?

I am using IntelliJ IDEA 13.1.4 and also tried the latest release 14. Running SBT I get the following error: Error:Cannot determine Java VM executable in selected JDK I have JDK 1.7 installed on my machine and on PATH. In the logs…
Zuriar
  • 11,096
  • 20
  • 57
  • 92
114
votes
5 answers

comparing sbt and Gradle

I am diving into Scala and noticed sbt. I have been quite happy with Gradle in java/groovy projects, and I know there's a scala plugin for Gradle. What could be good reasons to favour sbt over Gradle in a Scala project?
Hans Westerbeek
  • 5,645
  • 3
  • 34
  • 35
1
2 3
99 100